home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / yrndl13.zip / ydinstl.cmd < prev   
OS/2 REXX Batch file  |  1996-07-20  |  100KB  |  2,843 lines

  1. /*
  2. YDINSTL.CMD v 0.9 (beta) by Jerry Levy     20 Jul 96
  3. Comments appreciated: send to jlevy@ibm.net
  4. (Jerry Levy, Marblehead, MA)
  5. */
  6. version = '0.9(beta)'
  7. /*
  8. ================WHAT DO WE DO?================================
  9. YDINSTL.CMD v. 0.9(beta) is distributed as part of .ZIP archive YRNDL13.ZIP.
  10.  
  11. YDINSTL.CMD is a Rexx program to install YARNDIAL.
  12.  
  13. YARNDIAL is a program to automate the use of YARN and SOUPER
  14. It serves as a front end for C.T. Huang's OS/2 Souper and Yarn programs. 
  15.  
  16. YD.DOC is documentation for both the installer and YARNDIAL.
  17.  
  18. README.1ST is YD.DOC boiled down to essentials.
  19.  
  20. This installer goes out and fetches parameters required by
  21. YARNDIAL.  Installations can be done for every yarn user you
  22. have set up.  Read YD.DOC to learn more about setting up for
  23. multiple users (A different "user" could be a different ID,
  24. an installation for a different internet provider, or a
  25. different internet connection mode for a given ID).
  26.  
  27. Each different user for which you set up YARN has been assigned
  28. its own home directory and you can (should) do an install with
  29. YDINSTL.CMD for each.  For each installation, separate Desktop
  30. objects are created which are named to uniquely tie them to a
  31. particular installation.  For each installation, a unique
  32. parameter file (YD_PARMS.DAT) is created and stored in the
  33. home directory.
  34.  
  35. YDINSTL.CMD also creates a suite of useful Rexx .CMD utilities
  36. which are placed in the home directory also.
  37.  
  38. This YDINSTL.CMD is distributed with YARNDIAL v1.3.  It will not
  39. work with previous versions of YARNDIAL (v. 1.0 and 1.1).
  40.  
  41. ===========History============
  42. 20 Jul 96 v. 0.9 (first beta)
  43. ==============================
  44.  
  45. ==========COPYRIGHT NOTICE AND DISCLAIMER=============
  46. YDINSTL.CMD is Copyright 1996 by Jerry Levy (all rights reserved)
  47. YARNDIAL.CMD is Copyright 1995 and 1996 by Jerry Levy (all rights reserved)
  48.  
  49. These are provided as-is and without charge, with no warranty expressed
  50. or implied as to merchantability or fitness for any particular purpose.  All
  51. responsibility for any and all incidental and consequential damages is
  52. disclaimed.  These programs and associated text files are freeware.  They
  53. may be distributed without restriction providing: (1) this notice and
  54. disclaimer remain intact, (2) all programs and files are included and
  55. unchanged, and (3) they are distributed either in the original .zip archive
  56. or the archive after being unzipped into a folder or onto a disk or other
  57. medium.  Use of either or both of these programs constitutes acceptance
  58. of these terms by all users.
  59. ======================================================
  60. */
  61.  
  62. bs = d2c(8)
  63. tab = d2c(9)            /* Backspace */
  64. cr = d2c(13)            /* enter key, as well as carriage return */
  65. crlf = d2c(13) || d2c(10)    /* carriage return + linefeed */
  66. escape = d2c(27)        /* escape character */
  67. X1 = d2c(0)            /* Extended key */
  68. X2 = d2c(224)            /* Extended key */
  69.  
  70. /* Load RexxUtil if not already loaded */
  71. if RxFuncQuery('SysLoadFuncs') \= 0 then
  72.    do
  73.       call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  74.       call SysLoadFuncs
  75.    end
  76.  
  77. candidate = ''
  78. encrypt = 0
  79. parse arg instr candidate
  80. if translate(instr) = 'ENCRYPT' then
  81.    do
  82.       call SysCls
  83.       say ''
  84.       encrypt = 1
  85.       call encry
  86.       exit
  87.    end
  88.  
  89. /* Initialize these (except yarnshell_ico).  These are files
  90. used by or created during installation */
  91. yd_doc = 'YD.DOC'            /* documentation file */
  92. readme_1st = 'README.1ST'        /* shorter one */
  93. ydparms_dat = 'YD_PARMS.DAT'    /* where we will store parameters */
  94. yd_cmd = 'YARNDIAL.CMD'        /* this is the YarnDial file we are installing for */
  95. ydinstl_cmd = 'YDINSTL.CMD'        /* and this is us, the installer */
  96. yarn_ico = 'YARN.ICO'            /* the Yarn icon (courtesy of C.T. Huang) */
  97. yarnshell_ico = yarn_ico        /* ...which we use more than once */
  98. yarndial_ico = 'YARNDIAL.ICO'    /* the YarnDial icon */
  99. ydfold1_ico = 'YDFOLD1.ICO'        /* for our desktop folder: icon for when it is closed */
  100. ydfold2_ico = 'YDFOLD2.ICO'        /* for our desktop folder: animated icon, folder when open */ 
  101. yarnutil_ico = 'YRNUTIL.ICO'        /* for yarnutil_cmd */ 
  102. logoff_ico = 'LOGOFF.ICO'        /* for logoff_cmd */ 
  103. renewzip_ico = 'RENEWZIP.ICO'    /* for renewzip_cmd */ 
  104. ydinstl_ico = 'YDINSTL.ICO'        /* for ydinstl_cmd */
  105.  
  106. signal on failure
  107. signal on halt
  108. signal on syntax
  109. signal on notready
  110. signal on error
  111.  
  112. Trace 'N'
  113.  
  114. call time 'R'
  115. yd_cmd_v = '2.0'
  116.  
  117. /*
  118. ============================
  119. We use Abandon=1 returned by a subroutine
  120. as a signal to abort.  We abort by making a
  121. conditional call to exit in the caller routine,
  122. example:     if Abandon then signal goodbye()
  123. ============================
  124. */
  125.    Abandon = 0
  126.  
  127. /* Completed flag will be set to 1 when we are done */
  128.    completed = 0
  129.  
  130. /* We count file-search errors */
  131.    findfile_ErrNum = 0
  132.  
  133. Upcase = xrange('A', 'Z')    /* Translation tables we use for going */
  134. Lowcase = xrange('a', 'z')    /* from upper to lower case or vice-versa */
  135.  
  136. parse source with this_pgm
  137. /* This program including path is last word.  Extract its
  138. path, stripping out a final \ */
  139.  
  140. this_pgm = word(this_pgm, words(this_pgm))
  141. source_drive = filespec('drive', this_pgm)
  142. source_subdir = filespec('path', this_pgm)
  143. source_path = source_drive || source_subdir
  144. source_path = strip(source_path, 'T', '\')
  145. source_path = translate(source_path)
  146. x = SetLocal()
  147.  
  148. '@echo off'            /* do not echo OS/2 commands */
  149. call welcome_to_this_installer    /* big welcome message */
  150. call initialize_variables
  151.  
  152. /* do we use the IAK Dialer, the Dial-Other-
  153. Internet-Providers utility, or a dialup string? */
  154. call get_connection_type
  155. call get_ini_paths        /* for dialer.ini and tcpos2.ini */
  156. call find_yarn_home_dir        /* set as an os/2 environment variable? or we can specify it */ 
  157. call find_yarn_dir        /* YARN, set as an os/2 environment variable */
  158.  
  159. /* get tcpos2ini_app, name in SLIPPM setup for the provider we use */
  160. if pos(connection_type, 'x234') \=0 then
  161.     tcpos2ini_app = get_dial_other_providers_app(tcpos2_ini)
  162.  
  163. /* If connection_type = 5 we need to get some information */
  164. if connection_type = 5 then
  165.    do
  166.       call get_userID_and_domain
  167.       call are_we_SLIP_or_PPP
  168.    end
  169.  
  170. /* read in some assignments from the Yarn CONFIG file */
  171. call get_parms_from_yarn_config
  172.  
  173. /* dialer.ini stores the IAK Dialer parameters... */
  174. if connection_type = 1 then
  175. do
  176.    call get_parms_from_advantis_dialerini
  177.    call get_adv_password
  178. end
  179.  
  180. /* ...whereas tcpos2.ini stores all of the slippm parameters */
  181. if pos(connection_type, 'x234') \=0 then
  182.    call get_parms_from_tcpos2ini
  183.  
  184. /* What kind of compression utilities? InfoZip's? PkWare's? others'? */
  185. call whose_zips_are_we_using
  186.  
  187. /* Do searches for files we need.  Gets full paths */
  188. call search_for_files
  189.  
  190. /* For connection_type 1, 2 and 4 we construct dialup_string
  191. and store it in YD_PARMS.DAT */
  192.  
  193. if connection_type = 1 then
  194.    dialup_string ='''start' IAKdialer_exe || ''' account user password'
  195.  
  196. if connection_type = 2 then
  197.    dialup_string ='''start' slippm_exe || ''' tcpos2ini_app'
  198.  
  199. if connection_type = 4 then
  200.    dialup_string = 'do;',
  201.                    '''' || injoy_drive || ''';',
  202.                    '''cd' injoy_dir || ''';',
  203.                    '''start /c' injoy_exe || ''' tcpos2ini_app;',
  204.                    'end'
  205.  
  206. /* Tailor how you want souper to run: can modify some command-line options */
  207. call souper_options
  208.  
  209. /* How many seconds before dialer times out (for connection_type 1, 2, and 3) */
  210. call get_dialer_timeout_wait
  211.  
  212. /* Up to this point, no changes have been made.  A chance
  213. to exit the install at this point without making any changes */
  214. call chance_to_quit
  215.  
  216. /* Create the YD_PARMS.DAT file where all our parameters go.
  217. YARNDIAL.CMD uses this file as a setup file */
  218. call output_dat
  219.  
  220. /* Copy files over from installation directory to home dir */
  221. call copy_ydfiles
  222.  
  223. /*
  224. ==============
  225. We create a suite of five customized REXX utilities on the HOME directory.
  226.  
  227. YARNSHELL.CMD:  Runs YARN.EXE from the correct environment for this user
  228.  
  229. YARNUTIL.CMD:  Run any yarn utility pgm for this user
  230.  
  231. RENEWZIP.CMD:  Restores the reply_packet .ZIP file (backed up during
  232.    an attempt to export) for a re-try later (RENEWZIP.CMD), again for this user
  233.  
  234. LOGOFF.CMD:  Provides a convenient way to log off
  235.  
  236. OBJECTS.CMD:  Restores a folder object and contents (objects for the four
  237. .CMD files above, plus an object for YarnDial.CMD, for this user installation
  238. ==============
  239. */
  240. call create_yarnshell_cmd
  241. call create_yarnutil_cmd
  242. call create_logoff_cmd
  243. call create_renewzip_cmd
  244. call create_yarndial_objects
  245.  
  246. /* Finally we create a Rexx pgm to recreate objects */
  247. call recreate_objects_cmd
  248. signal goodbye        /* cleanup and exit */
  249. EXIT
  250. /*
  251. ==============================================
  252. End of Main Program
  253. ==============================================
  254. */
  255.  
  256. /*
  257. ==============================================
  258. get_connection_type()
  259.  
  260. Are we installing for a connection to Advantis
  261. via the IAK Dialer
  262.    or
  263. a connection via either SLIP or PPP using the
  264. Dial-Other-Internet-Providers Utility?
  265. ==============================================
  266. */
  267. get_connection_type:
  268. edit_dialup_string_msg =  ''    /* initialize to a blank */
  269. call SysCls
  270. say ''
  271. say 'CONNECTION-TYPE SCREEN'
  272. say 'Must select the type of connection you will be making'
  273. say ''
  274. say 'Choose how you will dial in to connect:'
  275. say '  1 With the IAK Internet Dialer to connect to Advantis (SLIP)'
  276. say '  2 Using SLIPPM=the Dial-Other-Internet-Providers utility'
  277. say '    (whether for a SLIP or PPP connection)'
  278. say '  3 My own slip.exe or ppp.exe dialup string or some dialup'
  279. say '    string that uses ppp.exe or slip.exe (e.g., slppm.exe does)'
  280. say '  4 Using the IN-JOY Dialer'
  281. say '  5 I will try to set up' ydparms_dat 'manually (read' yd_doc || '),'
  282. say '    but help me do a partial setup'
  283. say ''
  284. say ' FOR OPTIONS 2, 3 or 4: Dial-Other-Internet-Providers utility'
  285. say ' (i.e., SLIPPM.EXE) <<MUST>> be configured properly, even if'
  286. say ' you will use your own dial-in string or IN-JOY to dial up.'
  287. say ' Reason: SLIPPM stores parameters that we need where we can'
  288. say ' get at them.'
  289. say ''
  290. do until connection_type = pos(connection_type, '12345')
  291.    say ''
  292.    prompt = 'Select 1-5 or Escape to quit:'
  293.    say prompt
  294.       parse value SysCurPos() with row col
  295.       row  = row - 1
  296.       col = 0
  297.       call SysCurPos row, col
  298.    connection_type = SysGetKey('NOECHO')
  299.    if connection_type = escape then signal goodbye
  300. end
  301.  
  302. if connection_type = 1 then
  303.    do
  304.       service = 'SLIP'
  305.       say 'Selected: Advantis (IAK Dialer)                    '
  306.    end
  307. if connection_type = 2 then
  308.    do
  309.       say 'Selected: Dial-Other-Internet-Providers (D-O-I-P)                            '
  310.    end                  
  311. if connection_type = 3 then
  312.    do
  313.       say 'Selected: Dialup with a ppp.exe or slip.exe dialup string'
  314.       edit_dialup_string_msg = crlf ||,
  315.          'Remember to fill in the dialup_string called for in' ydparms_dat
  316.    end     
  317. if connection_type = 4 then
  318.    do
  319.       say 'Selected: IN-JOY dialer                                          '
  320.    end     
  321. if connection_type = 5 then
  322.    do
  323.       say 'Selected: Mostly manual configuraltion of' ydparms_dat
  324.       edit_dialup_string_msg = crlf ||,
  325.          'Remember to manually revise (edit)' ydparms_dat
  326. /* Identify some parameters in YD_PARMS.DAT to be edited */
  327.       dialup_string='**Fill in.  Or leave blank if you will not be dialing up.**'
  328.       DEFAULT_NEWS='**News Server, example:   netnews.worldnet.att.net**'
  329.       MAIL_GW='**Mail Gateway=SMTP Server, example:   mailhost.worldnet.att.net**'
  330.       POPSRVR='**POP3 Server, example:   postoffice.worldnet.att.net**'
  331.       adv_password = '**Run YDINSTL encrypt MyPassword to encrypt for insertion**'
  332.       PWD = '**Run YDINSTL encrypt MyPassword to encrypt MyPassword for insertion**'
  333.       POP_PWD = '**Run YDINSTL encrypt MyPassword to encrypt MyPassword for insertion**'
  334.    end     
  335. say ''
  336. say 'Escape quits.  Press any other key to continue'
  337. if SysGetKey('ECHO') = Escape then signal goodbye
  338. RETURN
  339.  
  340.  
  341. /*
  342. ==============================================
  343. Determine paths to DIALER.INI and TCPOS2.INI
  344. ==============================================
  345. */
  346. get_ini_paths:
  347. dialerini_exists = 0
  348. tcpos2ini_exists = 0
  349. tcpip_etc_path = value('etc', , 'OS2ENVIRONMENT')
  350. dialer_ini = tcpip_etc_path || '\' || 'dialer.ini'
  351. if stream(dialer_ini, 'c', 'query exists') \= 0 then
  352.    do
  353.       dialerini_exists = 1
  354.    end
  355. tcpos2_ini = tcpip_etc_path || '\' || 'tcpos2.ini'
  356. if stream(tcpos2_ini, 'c', 'query exists') \= 0 then
  357.    do
  358.       tcpos2ini_exists = 1
  359.    end
  360. RETURN
  361.  
  362. /*
  363. ==============================================
  364. Locate the Yarn HOME directory.  It could be set as an
  365. OS/2 environmental variable, but if it isn't, prompt us
  366. for it.  You can install Yarn with separate home directories
  367. for each user.  A lot of other applications set up HOME
  368. as an environmental variable so the home directory in the
  369. OS/2 environment may not be the correct one for this
  370. installation.
  371.  
  372. To determine if we have the right home directory we look
  373. for Yarn's config file which is located in home's /yarn/
  374. subdirectory.
  375. ==============================================
  376. */
  377. find_yarn_home_dir:
  378. /* Get the Yarn Home Directory */
  379. entry = ''    /* initialize it to a blank */
  380.  
  381. call SysCls
  382. say ''
  383. say 'YARN''s HOME DIRECTORY Screen'
  384.  
  385. home = value('home', , 'OS2ENVIRONMENT')
  386. home = translate(home)
  387. yarn_config = home || '\yarn\config'
  388. if home = '' then
  389.    do
  390.       say ''
  391.       say 'Unable to find HOME as an OS/2 environment variable.'
  392.       say 'That means you did not include a SET HOME statement in'
  393.       say 'config.sys or you did not reboot after modifying config.sys.'
  394.       say 'You will be able to enter a HOME directory name.'
  395.       say ''
  396.    end
  397. if stream(yarn_config, 'c', 'query exists') \= '' then
  398.    do
  399.       say ''
  400.       say 'We found' home 'as a possible YARN home directory.'
  401.       say ''
  402.       say 'You may have set up Yarn with more than one user'
  403.       say 'and more than one home directory or this could be'
  404.       say 'another program''s home directory.'
  405.       say ''
  406.       say 'To accept   ' home '   as the home directory press ENTER,'
  407.       say 'or key in the full path of the Yarn HOME directory you wish'
  408.       prompt = 'to do this installation for:'
  409.          say prompt
  410.          parse value SysCurPos() with row col
  411.          row  = row - 1
  412.          col = length(prompt) + 2
  413.          call SysCurPos row, col
  414.       parse upper pull entry
  415.    end 
  416. if entry \= '' then home = entry
  417. home = strip(home, 'B')
  418. yarn_config = home || '\YARN\CONFIG'
  419. do forever
  420.    if stream(yarn_config, 'c', 'query exists') \= '' then
  421.       do
  422.          leave
  423.       end
  424.          say ''
  425.          say 'Unable to find' yarn_config '(HOME dir is in error)'
  426.          say ''
  427.          if home \= '' then
  428.             do
  429.                say translate(home) 'as HOME directory is in error'
  430.             end
  431.          prompt = 'Enter correct Yarn HOME directory path now:'
  432.          say prompt
  433.             parse value SysCurPos() with row col
  434.             row  = row - 1
  435.             col = length(prompt) + 2
  436.         call SysCurPos row, col
  437.         pull entry
  438.         entry = strip(entry, 'T', '\')    /* strip any trailing \ if entered */
  439.         home = entry
  440.         yarn_config = home || '\yarn\CONFIG'
  441. end
  442.  
  443. yarn_config = home || '\yarn\CONFIG'
  444. yarn_config = translate(yarn_config)
  445. home_drive = filespec('drive', yarn_config)
  446. home_drive = translate(home_drive)
  447. ydparms_dat = home || '\' || ydparms_dat
  448. ydparms_dat = translate(ydparms_dat)
  449.  
  450. say ''
  451. say 'Installing for' home 'as the Yarn HOME directory.'
  452. say ''
  453. say ''
  454. say 'OK.  Press any key to continue'
  455. call SysGetKey 'NOECHO'
  456. RETURN
  457.  
  458. /*
  459. ==============================================
  460. Where is the Yarn directory?
  461.  
  462. We look for yarn in the OS/2 environment.  If we don't
  463. find it we exit install.  All of the yarn files should
  464. be there:
  465.    import.exe
  466.    export.exe
  467.    rebuild.exe
  468.    expire.exe
  469.    yarn.exe      and more
  470. but we search for yarn.exe to verify it is (probably)
  471. a valid YARN directory.
  472. ==============================================
  473. */
  474.  
  475. find_yarn_dir:
  476. /* Get the Yarn Directory */
  477. entry = ''    /* initialize it to a blank */
  478.  
  479. call SysCls
  480. say ''
  481. say 'YARN DIRECTORY'
  482. say '(Directory where most of the YARN programs are kept)'
  483.  
  484. yarn = value('yarn', , 'OS2ENVIRONMENT')
  485. yarn = translate(yarn)
  486. yarn_exe = yarn || '\' || yarn_exe
  487. if yarn = '' then
  488.    do
  489.       say 'Unable to find YARN as an OS/2 environment variable.'
  490.       say 'That means you did not include a SET YARN statement in'
  491.       say 'config.sys or you did not reboot after modifying config.sys.'
  492.       say 'You will be able to enter a YARN directory name.'
  493.       say ''
  494.    end
  495. if stream(yarn_exe, 'c', 'query exists') \= '' then
  496.    do
  497.       say ''
  498.       say 'We found' yarn 'as a possible YARN directory.'
  499.       say ''
  500.       say 'You may have set up Yarn with more than one YARN'
  501.       say 'directory or this could be a temporary directory'
  502.       say 'you used to install YARN.'
  503.       say ''
  504.       say 'To accept   ' yarn '   as the YARN directory press ENTER,'
  505.       say 'or key in the full path of the YARN directory you wish'
  506.       prompt = 'to do this installation for:'
  507.          say prompt
  508.          parse value SysCurPos() with row col
  509.          row  = row - 1
  510.          col = length(prompt) + 2
  511.          call SysCurPos row, col
  512.       parse upper pull entry
  513.    end 
  514. if entry \= '' then yarn = entry
  515. yarn = strip(yarn, 'B')
  516. yarn_exe = filespec('name', yarn_exe)    /* get back to name only */
  517. yarn_exe = yarn || '\' || yarn_exe    /* reconstruct fully qualified path */
  518.  
  519. do forever
  520.    if stream(yarn_exe, 'c', 'query exists') \= '' then
  521.       do
  522.          leave
  523.       end
  524.          say ''
  525.          say 'Unable to find' yarn_exe '(YARN dir is in error)'
  526.          say ''
  527.          if yarn \= '' then
  528.             do
  529.                say translate(yarn) 'as YARN directory is in error'
  530.             end
  531.          prompt = 'Enter correct YARN directory path now:'
  532.          say prompt
  533.             parse value SysCurPos() with row col
  534.             row  = row - 1
  535.             col = length(prompt) + 2
  536.         call SysCurPos row, col
  537.         pull entry
  538.         entry = strip(entry, 'T', '\')    /* strip any trailing \ if entered */
  539.         yarn = entry
  540.         yarn_exe = filespec('name', yarn_exe)    /* get back to name only */
  541.         yarn_exe = yarn || '\' || yarn_exe        /* this is what we look for */
  542. end
  543.  
  544. yarn_exe = yarn || '\' || yarn_exe        /* this is what we look for */  
  545. yarn_exe = translate(yarn_exe)
  546. yarn_drive = filespec('drive', yarn_exe)
  547. yarn_drive = translate(yarn_drive)
  548. yarn_path = yarn || '\'
  549. home_path = home || '\'
  550. yarn_exe = filespec('name', yarn_exe)  /* OK, again get back to name only */
  551.  
  552. souper_exe = yarn_path || souper_exe
  553. yarn_exe = yarn_path || yarn_exe
  554. import_exe = yarn_path || import_exe
  555. export_exe = yarn_path || export_exe
  556. expire_exe = yarn_path || expire_exe
  557. rebuild_exe = yarn_path || rebuild_exe
  558. go_exe = home_path || go_exe
  559. yarn_drive = filespec('drive', import_exe)
  560.  
  561. say ''
  562. say 'Installing for' yarn 'as the YARN directory.'
  563. say ''
  564. say ''
  565. say 'OK.  Press any key to continue'
  566. call SysGetKey 'NOECHO'
  567. if connection_type = 1 then say 'Password module loading...'
  568. RETURN
  569.  
  570. /*
  571. ==============================================
  572. get_dial_other_providers_app()
  573.  
  574. If you are making a PPP or SLIP connection using the
  575. Dial-Other-Internet-Providers utility, we will have your
  576. "application" (i.e., the setup you did for your provider
  577. in the tcpos2.ini file.  Here you can select which
  578. application you are installing for.  Be careful, there
  579. are "applications" here that are not related to a
  580. specific provider setup.
  581. ==============================================
  582. */
  583. get_dial_other_providers_app:
  584. arg inifile
  585. call SysCls
  586. say ''
  587. say 'DIAL_OTHER_INTERNET_PROVIDERS SCREEN'
  588. say ''
  589. result = SysIni(inifile, 'ALL:', 'apps')
  590. if result \= 'ERROR:' then
  591.    do j = 1 to apps.0
  592.       say j apps.j
  593.    end
  594. say '     Select the item above by number which'
  595. say '     is the Dial-Other-Internet-Provider application for'
  596. say '     this installation.'
  597.  
  598. do until DataType(DOIP, 'W') & DOIP > 0 & DOIP < j
  599.    prompt = 'Selection:' 
  600.    say prompt
  601.       parse value SysCurPos() with row col
  602.       row  = row - 1
  603.       col = length(prompt) +2
  604.       call SysCurPos row, col
  605.    parse pull DOIP
  606.    if \DataType(DOIP, 'W') | DOIP <1 | DOIP > j-1 then
  607.    do
  608.       say 'Must be 1-' || j-1
  609.    end
  610. end
  611. say ''
  612. say 'Selected Application:' apps.DOIP
  613. say ''
  614. say ''
  615. say 'Press any key to continue'
  616. call SysGetKey 'NOECHO'
  617. say 'Please wait while parameters are being loaded...'
  618. RETURN apps.DOIP
  619.  
  620. /*
  621. ==============================================
  622. whose_zips_are_we_using()
  623.  
  624. You can select which kind of compression and
  625. uncompress utilities you use.  The os/2 InfoZip
  626. ports are recommended.
  627. ==============================================
  628. */
  629. whose_zips_are_we_using:
  630. /* Get path to zip files, also specify which we use */
  631. zip_type = 0
  632. call SysCls
  633.    say ''
  634.    say 'COMPRESSION/UNCOMPRESSION SCREEN'
  635.    say ''
  636.    say 'Select which type of compress and uncompress programs'
  637.    say 'you will use.  You must use them.  Recommended is the OS/2'
  638.    say 'port of InfoZip compression and uncompression programs.  You'
  639.    say 'can also select to use the MS-DOS PkWare programs.'
  640.    say ''
  641.    say 'Select from among:'
  642.    say '1  OS/2 InfoZip series (e.g., from zip201c2.zip and unz512x2.zip'
  643.    say '   archives, or later versions)'
  644.    say '2  MS-DOS PkWare (e.g., from the PKZ204G.ZIP archive)'
  645.    say '3  Any other type, whether OS/2 or MS-DOS based'
  646.    say '(ESC exits install program now)'
  647. do until pos(zip_type, '123') \= 0
  648.    prompt = 'Select 1, 2, or 3:'
  649.    say prompt
  650.    zip_type = SysGetKey('NOECHO')
  651.    select
  652.       when zip_type = Escape then signal goodbye
  653.       when zip_type = 1 then
  654.          do
  655.             say ''
  656.             file_msg1 = 'OS/2 InfoZip' /* This is the default */
  657.             say 'Selected: ' file_msg1
  658.             zip_exe = os2_zip_exe
  659.             zip_options = os2_zip_options
  660.             unzip_exe = os2_unzip_exe
  661.             unzip_options = os2_unzip_options
  662.          end
  663.       when zip_type = 2 then
  664.          do
  665.             say ''
  666.             file_msg1 = 'MS-DOS PkWare'
  667.             say 'Selected: ' file_msg1
  668.             zip_exe = msdos_zip_exe
  669.             zip_options = msdos_zip_options
  670.             unzip_exe = msdos_unzip_exe
  671.             unzip_options = msdos_unzip_options
  672.          end
  673.       when zip_type = 3 then
  674.          do
  675.             zip_exe = ''
  676.             unzip_exe = ''
  677.             say ''
  678.             say 'Selected: (OTHER)'
  679.             say 'You will need to edit the zip_exe and unzip_exe entries'
  680.             say 'in' ydparms_dat 'after installation is complete.'
  681.             say 'Refer to' yd_doc 'for help on how to customize for'
  682.             say 'other compression and uncompression utilities.'
  683.          end
  684.       when pos(zip_type, '123') = 0 then
  685.          do
  686.             say ''
  687.             say ''
  688.             say 'You may only enter 1,2 or 3 (or press ESC to quit)'
  689.             say ''
  690.          end
  691.       otherwise NOP
  692.    end
  693. end
  694. say ''
  695. say ''
  696. say 'Press any key to continue'
  697. call SysGetKey 'NOECHO'
  698. RETURN
  699.  
  700. /*
  701. =====================================      
  702. search_for_files()
  703.  
  704. We search for various files with calls to the
  705. file_locator() routine.  In the case of the zip and
  706. unzip files, we also attach their option strings.
  707. =====================================      
  708. */
  709.  
  710. search_for_files:
  711. /* The flag Abandon is returned = 1 if the file_locator() routine encounters a request to abort */
  712.  
  713. zip_exe = file_locator(zip_exe)
  714. if Abandon then signal goodbye
  715. unzip_exe = file_locator(unzip_exe)
  716. if Abandon then signal goodbye
  717. souper_exe = file_locator(souper_exe)
  718. if Abandon then signal goodbye
  719. if connection_type \= 4 then
  720.    do
  721.       call SysCls
  722.       say ''
  723.       say 'You did not select the IN-JOY dialer, but we will search'
  724.       say 'for IN-JOY''s utility, KILLJOY.EXE, anyway.  That way,'
  725.       say 'if KILLJOY is on your hard-disk, the LOGOFF utility that'
  726.       say 'YDINSTL creates will be as useful as possible.'
  727.       say 'No problem is created if we cannot find KILLJOY.EXE' 
  728.       say ''
  729.       say 'Press any key to continue'
  730.       call SysGetKey 'NOECHO'
  731.    end
  732. killjoy_exe = file_locator(killjoy_exe)
  733. if connection_type = 4 then
  734.    do
  735.       if Abandon then signal goodbye
  736.       injoy_exe = file_locator(injoy_exe)
  737.       if Abandon then signal goodbye
  738.  
  739. /* get the drive and construct path to in-joy.exe */
  740.       injoy_drive = filespec('drive', injoy_exe)
  741.       injoy_dir = injoy_drive || strip(filespec('path', injoy_exe), 'T', '\')
  742.    end
  743. zip_exe = zip_exe zip_options
  744. unzip_exe = unzip_exe unzip_options
  745. say 'Patience...'  /* sometimes the next step takes a while to start */
  746. RETURN
  747.  
  748. /*
  749. =====================================================
  750. file_locator()
  751.  
  752. is a file finder that not only searches all available
  753. local drives for all instances found of that file, but
  754. provides a menu allowing you to select a single instance.
  755. If the filename being searched for has been fed to the
  756. routine with arguments or with a fully qualified path,
  757. the path and all arguments are stripped out so only
  758. the pure filename itself is searched.
  759.  
  760.  
  761. Syntax: file_locator(filename)
  762.  
  763. Returns the fully qualified path of the instance you
  764. select if at least one instance is found, or returns
  765. a blank ('') if none is found.  If only one instance
  766. is found, it is automatically selected (you get no
  767. menu, but you do get a 'found' notice).
  768.  
  769. The exposed variables in this procedure are
  770.    instances        Number of occurrences found
  771.    file_selected    The single instance we chose
  772.    unfound_file.    Stem in case of an error...
  773.    findfile_ErrNum     ...index for the stem1
  774. (an unfound file is unfound_file.findfile_ErrNum)
  775.    Abandon        a flag. If = 1 the calling program should exit 
  776. =====================================================
  777. */
  778. file_locator: procedure expose,
  779.           instances,
  780.           file_selected,
  781.           unfound_file.,
  782.           findfile_ErrNum,
  783.           Abandon
  784.  
  785. parse upper arg filename
  786.  
  787. escape = d2c(27)             /* escape character */
  788. file_spec = filespec('name', filename)
  789. call SysCls
  790. say ''
  791. say ''
  792. say ''
  793. say ''
  794. say 'Searching for' file_spec
  795. say ''
  796. say 'Search is restricted to local drives only.'
  797. say 'Remove media from local CD-ROM drives and other'
  798. say 'removable-media drives or we will search them, too.'
  799. say ''
  800.  
  801. map = SysDriveMap( , 'LOCAL')
  802. drives = words(map)
  803. instances = 0
  804. do i = 1 to drives
  805.    drive.i = word(map, i)
  806.    if SysDriveInfo(drive.i) = '' then iterate
  807.    prompt = 'Searching' drive.i
  808.    say prompt
  809.       parse value SysCurPos() with row col
  810.       row  = row - 1
  811.       col = 0
  812.       call SysCurPos row, col
  813.    filsp = drive.i || '\' || file_spec    /* filespec with path */
  814.    rc = SysFileTree(filsp, 'file', 'FS')
  815.    do n = 1 to file.0
  816.       instances = instances + 1            /* a counter */
  817.       file_found.instances = file.n
  818.    end
  819. end
  820.  
  821. /*
  822. ==================
  823. If instances=0, that means we found no instance(s)
  824. of the file.  Maybe the file name is changed.  Error
  825. message.  But we continue the install because maybe
  826. the filename can be corrected by editing YD_PARMS.DAT
  827. when we are done
  828. =================
  829. */
  830.  
  831. if instances = 0 & connection_type \= 4 then
  832.    do
  833.       findfile_ErrNum = findfile_ErrNum +1
  834.       call  beep 262, 200
  835.       say ''
  836.       say ''
  837.       
  838.       say 'MAJOR ERROR:  we found no instances of' file_spec || '.'
  839.       say 'Maybe the file name has been changed.  We'
  840.       say 'can continue, hoping the error can be corrected'
  841.       say 'by editing the name in the .DAT file that we create'
  842.       say 'in the specific HOME directory we are installing for.'
  843.       say ''
  844.       say 'Or you can Escape and correct now (recommended).'
  845.       say ''
  846.       
  847. /* This next line is for possible use in an error message
  848. identifying this file which we can't find. */
  849.  
  850.       unfound_file.findfile_ErrNum = file_spec
  851.       
  852.       file_spec.instances = ''
  853.       file_spec.instance_number = 'file_spec'
  854.  
  855.       prompt = 'Escape quits YDINSTL.  Any other key continues'
  856.       say prompt
  857.          parse value SysCurPos() with row col
  858.          row  = row - 1
  859.          col = length(prompt) + 2
  860.          call SysCurPos row, col
  861.       if connection_type \4 then
  862.          if SysGetKey('NOECHO') = escape then Abandon = 1
  863.    end
  864.  
  865. if instances > 1 | instances = 1 then    /* We list them all */
  866.    do      
  867.       say ''
  868.       prompt = 'Found:  ' instances 'instance(s) of' file_spec
  869.          parse value SysCurPos() with row col
  870.          row  = row -1
  871.          col = 0
  872.          call SysCurPos row, col
  873.       if instances > 1 then say prompt
  874.       do i = 1 to instances
  875.          parse var file_found.i date.i time.i size.i attrib.i file_spec.i
  876.          date.i = right(date.i, 9)
  877.          time.i = right(time.i, 7)
  878.          size.i = right(size.i, 10)
  879.          file_spec.i = strip(file_spec.i, 'B')
  880.          if instances > 1 then say i date.i time.i size.i file_spec.i
  881.          if i \= 0 & i // 15 = 0 & instances > i then
  882.          do
  883.             say '   There are more, press any key to continue'
  884.             say '   If one of these is the right one, remember the number!!!'
  885.             call SysGetKey 'NOECHO'
  886.          end
  887.       end
  888.    end
  889.  
  890. if instances > 1 then    /* We prompt for which one to select */
  891.  
  892.    do until DataType(instance_number,'W') & instance_number < instances + 1
  893.       prompt = 'Which is the correct file_spec to use?' 
  894.       say prompt
  895.       parse value SysCurPos() with row col
  896.          row  = row -1
  897.          col = length(prompt) +2
  898.          call SysCurPos row, col
  899.       if instances > 1 then
  900.          do
  901.             pull instance_number
  902.             if \DataType(instance_number, 'W') then
  903.                do
  904.                   say 'Whole number only. Try Again.'
  905.                end
  906.             if instance_number > instances then
  907.                do
  908.                   say 'Cannot exceed' instances || '.  Try again.'
  909.                end
  910.          end
  911.    end
  912.  
  913. /* If only one instance, we do not need
  914. to prompt or select the menu number because
  915. instance_number is 1.  */
  916.  
  917. if instances = 1 then
  918.    do
  919.       instance_number = 1
  920.       say 'Found and selected one instance:'
  921.       say date.1 time.1 size.1 file_spec.1
  922.    end
  923.  
  924. if instances > 1 then say 'Selected:  ' file_spec.instance_number
  925.  
  926. if instances = 1 | instances > 1 then
  927.    do
  928.       say ''
  929.       say 'Press any key to continue'
  930.       call SysGetKey 'NOECHO'
  931.       say ''
  932.    end
  933. say ''
  934. say ''
  935. file_selected = file_spec.instance_number
  936. RETURN file_selected
  937.  
  938. /*
  939. ==============================================
  940. get_parms_from_yarn_config()
  941.  
  942. Read the yarn config file.  Reconstitute lines that
  943. have been continued on to the next line using
  944. the \ continuation character, then pick out lines
  945. with an = sign and that don't begin with the #
  946. comment-out character.  Then set up the USER and
  947. REPLY_PACKET variables.
  948. ==============================================
  949. */
  950. get_parms_from_yarn_config:
  951. n = 1
  952. do while lines(yarn_config) > 0
  953.     data_line = linein(yarn_config)
  954.     line.n = data_line
  955.     if pos('=', data_line) > 0 & \abbrev(line.n, '#') then
  956.        do
  957.           line.n = data_line
  958.           if right(line.n, 1) = '\' then
  959.              do until right(line.n, 1) \= '\'
  960.                 line_n_with_right_slash_stripped = strip(right(line.n,1), 'T', '\')
  961.                 next_data_line = linein(yarn_config)
  962.                 line.n = line_n_with_right_slash_stripped || next_data_line
  963.              end
  964.           n = n + 1
  965.           number_of_reconstituted_lines = n
  966.       end
  967. end
  968.  
  969. j = 1
  970. do until j = number_of_reconstituted_lines
  971.    parse var line.j first.j '=' last.j
  972.    do until first.j = stripped_F.j & last.j = stripped_L.j
  973.       stripped_F.j = strip(first.j, 'B')
  974.       first.j = strip(stripped_F.j, 'B', tab)
  975.       stripped_L.j = strip(last.j, 'B')
  976.       last.j = strip(stripped_L.j, 'B', tab)
  977.    end
  978.  
  979.    select
  980.       when abbrev(line.j, '#') then NOP
  981.       when translate(first.j) = 'USER' then user = last.j
  982.       when translate(first.j) = 'HOST' then host = last.j
  983.       when translate(first.j) = 'REPLY-PACKET' then reply_packet = last.j
  984.       otherwise NOP
  985.    end
  986.    j = j +1
  987. end
  988. RETURN
  989.  
  990. /*
  991. ==============================================
  992. get_parms_from_advantis_dialerini()
  993.  
  994. Get selected parameters from dialer.ini (for the
  995. Advantis IAK Dialer) for the application "user_user".
  996. Example, my user ID is jlevy so for me user_user
  997. is user_jlevy (all lower case) 
  998. ==============================================
  999. */
  1000. get_parms_from_advantis_dialerini:
  1001. /* Get parms from dialer.ini file.  The strip is of a final null character that for some reason gets fetched along with the parm */
  1002. user_user = 'user_' || user
  1003.    Upcase = xrange('A', 'Z')
  1004.    Lowcase = xrange('a', 'z')
  1005.    user_user = translate(user_user, Lowcase, Upcase) /* dialer.ini expects user_user to be all-lowercase */
  1006. adv_account = strip(SysIni(dialer_ini, user_user, 'act'), 'T', X1)
  1007. adv_newsserver = strip(SysIni(dialer_ini, user_user, 'ns'), 'T', X1)
  1008. adv_popserver = strip(SysIni(dialer_ini, user_user, 'ps'), 'T', X1)
  1009. adv_smtpserver = strip(SysIni(dialer_ini, user_user, 'sm'), 'T', X1)
  1010. connect_logfile = strip(SysIni(dialer_ini, 'AdvLog', 'Cfn'), 'T', X1)
  1011. ask = strip(SysIni(dialer_ini, user_user, 'ask'), 'T', X1)
  1012. gs = strip(SysIni(dialer_ini, user_user, 'gs'), 'T', X1)
  1013. ws = strip(SysIni(dialer_ini, user_user, 'ws'), 'T', X1)
  1014. dn1 = strip(SysIni(dialer_ini, user_user, 'dn1'), 'T', X1)
  1015. dn2 = strip(SysIni(dialer_ini, user_user, 'dn2'), 'T', X1)
  1016. is1 = strip(SysIni(dialer_ini, user_user, 'is1'), 'T', X1)
  1017. is2 = strip(SysIni(dialer_ini, user_user, 'is2'), 'T', X1)
  1018. rs1 = strip(SysIni(dialer_ini, user_user, 'rs1'), 'T', X1)
  1019. rs2 = strip(SysIni(dialer_ini, user_user, 'rs2'), 'T', X1)
  1020. fs1 = strip(SysIni(dialer_ini, user_user, 'fs1'), 'T', X1)
  1021. fs2 = strip(SysIni(dialer_ini, user_user, 'fs2'), 'T', X1)
  1022. md = strip(SysIni(dialer_ini, user_user, 'md'), 'T', X1)
  1023. pin = strip(SysIni(dialer_ini, user_user, 'pin'), 'T', X1)
  1024. emI = strip(SysIni(dialer_ini, user_user, 'emI'), 'T', X1)
  1025. RETURN
  1026.  
  1027. /*
  1028. ==============================================
  1029. get_parms_from_tcpos2ini()
  1030.  
  1031. Similarly, get the parameters (all of them) for the
  1032. Dial-Other-Internet-Providers "application" you had
  1033. selected when the GET_DIAL_OTHER_PROVIDERS_APP()
  1034. routine was run.
  1035.  
  1036. These are located in the TCPOS2.INI file.  Xi is the
  1037. null character.  It is returned with every value and
  1038. we strip it out
  1039. ==============================================
  1040. */
  1041. get_parms_from_tcpos2ini:
  1042. /* Get parms from tcpos2.ini file in the same way. */
  1043. PROVIDER = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'PROVIDER'), 'T', X1)
  1044. LOGIN_ID = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'LOGIN_ID'), 'T', X1)
  1045. PWD = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'PWD'), 'T', X1)
  1046. SAVE_PWD = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'SAVE_PWD'), 'T', X1)
  1047. PHONE_NUMBER = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'PHONE_NUMBER'), 'T', X1)
  1048. HANGUP = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'HANGUP'), 'T', X1)
  1049. SCRIPT = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'SCRIPT'), 'T', X1)
  1050. SERVICE = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'SERVICE'), 'T', X1)
  1051. YOURIP = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'YOURIP'), 'T', X1)
  1052. DESTIP = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DESTIP'), 'T', X1)
  1053. NETMASK = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'NETMASK'), 'T', X1)
  1054. MTU_SIZE = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'MTU_SIZE'), 'T', X1)
  1055. VJ_COMP = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'VJ_COMP'), 'T', X1)
  1056. HOSTNAME = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'HOSTNAME'), 'T', X1)
  1057. DOMAIN_NAME = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DOMAIN_NAME'), 'T', X1)
  1058. DNS = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DNS'), 'T', X1)
  1059. DEFAULT_NEWS = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DEFAULT_NEWS'), 'T', X1)
  1060. DEFAULT_WWW = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DEFAULT_WWW'), 'T', X1)
  1061. DEFAULT_GOPHER = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DEFAULT_GOPHER'), 'T', X1)
  1062. MAIL_GW = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'MAIL_GW'), 'T', X1)
  1063. POPSRVR = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'POPSRVR'), 'T', X1)
  1064. REPLY_DOMAIN = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'REPLY_DOMAIN'), 'T', X1)
  1065. REPLY_ID = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'REPLY_ID'), 'T', X1)
  1066. POP_ID = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'POP_ID'), 'T', X1)
  1067. POP_PWD = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'POP_PWD'), 'T', X1)
  1068. MODEM_TYPE = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'MODEM_TYPE'), 'T', X1)
  1069. COMPORT = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'COMPORT'), 'T', X1)
  1070. BAUD = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'BAUD'), 'T', X1)
  1071. DATABITS = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DATABITS'), 'T', X1)
  1072. PARITY = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'PARITY'), 'T', X1)
  1073. DIAL_MODE = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DIAL_MODE'), 'T', X1)
  1074. PREFIX = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'PREFIX'), 'T', X1)
  1075. PREFIX_ANS = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'PREFIX_ANS'), 'T', X1)
  1076. INIT = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'INIT'), 'T', X1)
  1077. INIT2 = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'INIT2'), 'T', X1)
  1078. DISABLE = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DISABLE'), 'T', X1)
  1079. DISABLE_SEQ = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DISABLE_SEQ'), 'T', X1)
  1080. DIAL_PREFIX = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'DIAL_PREFIX'), 'T', X1)
  1081. AUTOSTART = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'AUTOSTART'), 'T', X1)
  1082. TOTAL_CONNECT = strip(SysIni(tcpos2_ini, tcpos2ini_app, 'TOTAL_CONNECT'), 'T', X1)
  1083. RETURN
  1084.  
  1085. /*
  1086. ==============================================
  1087. get_userID_and_domain()
  1088.  
  1089. Prompt for this and verify
  1090. ==============================================
  1091. */
  1092.  
  1093. get_userID_and_domain:
  1094.  
  1095. call SysCls
  1096. say ''
  1097. say 'USER ID AND DOMAIN SCREEN'
  1098. say ''
  1099. say 'Enter UserID and domain in the form'
  1100. say '    userID@domain    (example: jlevy@ibm.net)'
  1101. say ''
  1102. userdomain = ''
  1103. match_userdomain = ''
  1104. do until match_userdomain = userdomain
  1105.    prompt = 'Enter userID with domain:'
  1106.    say prompt
  1107.       parse value SysCurPos() with row col
  1108.       row  = row - 1
  1109.       col = length(prompt) + 2
  1110.       call SysCurPos row, col
  1111.       parse pull userdomain
  1112.    if userdomain = '' then userdomain = '(nothing entered)'
  1113.    say ''
  1114.    prompt = 'Enter it again:'
  1115.    say prompt
  1116.       parse value SysCurPos() with row col
  1117.       row  = row - 1
  1118.       col = length(prompt) + 2
  1119.       call SysCurPos row, col
  1120.       parse pull match_userdomain
  1121.    if match_userdomain = '' then match_userdomain = '(nothing entered)'
  1122.    if match_userdomain \== userdomain then
  1123.       do
  1124.          say ''
  1125.          say match_userdomain 'does not match' userdomain
  1126.          say 'Try again'
  1127.       end
  1128.    if pos('@', userdomain) = 0 then
  1129.       do
  1130.          say 'Incorrect entry.  No @ symbol found'
  1131.          userdomain = 'A'; match_userdomain = 'B'
  1132.             /* these two assignments force inequality, and a reprompt */
  1133.       end 
  1134.    say ''
  1135. end
  1136. parse var userdomain user '@' domain_name
  1137. say 'user@domain_name is' user || '@' || domain_name
  1138. say ''
  1139. say 'Press any key to continue'
  1140. call SysGetKey 'NOECHO'
  1141.  
  1142. RETURN
  1143.  
  1144. /*
  1145. =========================
  1146. are_we_SLIP_or_PPP()
  1147.  
  1148. Which are we?
  1149. =========================
  1150. */
  1151. are_we_SLIP_or_PPP:
  1152. do until pos(service, 'SP') \= 0
  1153.    call SysCls
  1154.    say 'SLIP OR PPP?'
  1155.    say ''
  1156.    say 'Will this be a SLIP or PPP connection?'
  1157.    prompt = 'Enter S or P:'
  1158.    say ''
  1159.    say prompt
  1160.       parse value SysCurPos() with row col
  1161.       row  = row - 1
  1162.       col = length(prompt) + 2
  1163.       call SysCurPos row, col
  1164.    service = translate(SysGetKey('ECHO'))
  1165.    say ''
  1166.    if service = 'S' then
  1167.       do
  1168.          say 'Selected:  SLIP'
  1169.       end
  1170.    if service = 'P' then
  1171.       do
  1172.          say 'Selected: PPP'
  1173.       end
  1174.    if pos(service, 'SP') = 0 then say 'Must enter either S or P.  Try again'
  1175.    say ''
  1176. end
  1177. say ''
  1178. say 'Press any key to continue'
  1179. call SysGetKey 'NOECHO'
  1180. RETURN
  1181.  
  1182. /*
  1183. ==============================================
  1184. get_adv_password()
  1185.  
  1186. Prompt for the Advantis password.
  1187. ==============================================
  1188. */
  1189.  
  1190. get_adv_password:
  1191.  
  1192. call SysCls
  1193. say ''
  1194. say 'ADVANTIS POP PASSWORD SCREEN'
  1195. say ''
  1196. say 'If you press enter instead of entering a password, '
  1197. say 'password is not stored and you will be prompted for one.'
  1198. say 'This is the Advantis pop password (for Advantis, it is the'
  1199. say 'Advantis password for everything, actually).'
  1200. say ''
  1201. say ''
  1202. do until match = adv_password
  1203.    prompt = 'Enter password:'
  1204.    say prompt
  1205.       parse value SysCurPos() with row col
  1206.       row  = row - 1
  1207.       col = length(prompt) + 2
  1208.       call SysCurPos row, col
  1209.       call get_pw 'H'
  1210.    adv_password = password
  1211.    say ''
  1212.    prompt = 'Enter it again:'
  1213.    say prompt
  1214.       parse value SysCurPos() with row col
  1215.       row  = row - 1
  1216.       col = length(prompt) + 2
  1217.       call SysCurPos row, col
  1218.       call get_pw 'H'
  1219.       match = password
  1220.    if match \== adv_password then say 'The two did not match'
  1221.    say ''
  1222. end
  1223. RETURN
  1224.  
  1225. /*
  1226. ==============================================
  1227. get_pw()
  1228.  
  1229. The actual keyboard-entry routine is a modification
  1230. of one from the IBM Rexx Manual which is copyrighted
  1231. by IBM and is used here with permission.
  1232.  
  1233. get_pw() accepts the argument H, h, Hide, hide which
  1234. will echo * instead of the character.
  1235. ==============================================
  1236. */
  1237. get_pw: procedure expose password 
  1238.  
  1239. /* H or h or hide as argument echos chars as *
  1240. otherwise chars entered are echoed     */
  1241.  
  1242. parse upper arg hide_for_passwording
  1243. hide_for_passwording = abbrev(hide_for_passwording, 'H')
  1244.  
  1245. bs = d2c(8)
  1246. cr = d2c(13)            /* enter key, as well as carriage return */
  1247. escape = d2c(27)        /* escape character */
  1248. X1 = d2c(0)            /* Extended key */
  1249. X2 = d2c(224)            /* Extended key */
  1250.  
  1251. Valid = xrange(' ', '~') 
  1252. /* same as Valid = ' !"#$%&''()*+,-./0123456789:;',
  1253.          '<=>?@''ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  1254.          '[\]^_abcdefghijklmnopqrstuvwxyz{|}~'
  1255. very nearly every common printable */ 
  1256. password = ''
  1257. MaxLength = 254
  1258.  
  1259. do forever
  1260.    ch = SysGetKey('NOECHO')
  1261.    select
  1262.       when ch = Escape then signal goodbye  /* Escape, so we quit immediately */
  1263.       when ch = cr    /* Enter key pressed */
  1264.          then do
  1265.             say ''    /* Give carriage return */
  1266.             leave
  1267.          end
  1268.       when ch = bs    /* Backspace */
  1269.          then if password = ''
  1270.             then call  beep 262, 200    /* Tell us no chars to bs over */
  1271.          else do    /* Overstrike a blank */
  1272.             call charout , bs bs 
  1273.             password = left(password, length(password)-1)
  1274.          end
  1275.  
  1276.                         /* All other characters */
  1277.       when pos(ch, Valid) > 0
  1278.          then if length(password) = MaxLength
  1279.             then call beep 262, 200
  1280.             else do
  1281.                if hide_for_passwording = 1 then call charout , '*'
  1282.                else call charout , ch
  1283.                password = password || ch
  1284.             end
  1285.       otherwise do     /* Swallow next for Extended */
  1286.          if ch = X1 | ch = X2
  1287.             then call SysGetKey 'NOECHO'
  1288.          call  beep 262, 200
  1289.       end
  1290.    end
  1291. end
  1292. RETURN password 
  1293.  
  1294. /*
  1295. ==============================================
  1296. get_dialer_timeout_wait()
  1297.  
  1298. When we dial in, how long before we let our dialer time out?
  1299. ==============================================
  1300. */
  1301. get_dialer_timeout_wait:
  1302. call SysCls
  1303. say ''
  1304. say 'SET DIALER TIMEOUT'
  1305. say ''
  1306. say 'Wait how many seconds before Advantis dialer times out.'
  1307. say 'Default: 120 seconds'
  1308. say '(usually allows both main and backup number to be attempted)'
  1309. say ''
  1310. prompt = 'Press Enter to accept default, or enter wait in seconds:' 
  1311. do until DataType(wait,'W')
  1312.    say prompt
  1313.       parse value SysCurPos() with row col
  1314.       row  = row - 1
  1315.       col = length(prompt) + 2
  1316.       call SysCurPos row, col
  1317.       pull wait .
  1318.       if wait = '' then
  1319.          do
  1320.             wait = 120
  1321.          end
  1322.       if DataType(wait) = 0 then say 'Whole number only. Try Again.'
  1323.       else say 'wait =' wait 'seconds'
  1324. end
  1325. say ''
  1326. say 'Press any key to continue'
  1327. call SysGetKey 'NOECHO'
  1328. RETURN
  1329.  
  1330. /*
  1331. ==============================================
  1332. souper_options()
  1333.  
  1334. We set some new default options for souper
  1335. ==============================================
  1336. */
  1337.  
  1338. souper_options:
  1339. call SysCls
  1340. getnews_xtra_options = '' /* the defaults */
  1341. getmail_xtra_options = ''
  1342. option1 = ''
  1343. option2 = ''
  1344. option3 = ''
  1345.  
  1346. say ''
  1347. say 'SOUPER OPTIONS SCREEN'
  1348. say 'You can select some alternate default options when souper runs.'
  1349. say 'These can be over-ridden when you run YarnDial.  If you wish to,'
  1350. say 'you can set these and more by editing' ydparms_dat
  1351. say 'after this install has completed, instead of using this screen.'
  1352. do until opts = 5
  1353.    say ''
  1354.    say 'Press:'
  1355.    say '  1 Set maximum news packetsize (default is 2048KB [2.048MB])'
  1356.    say '  2 Do not retrieve newsgroup articles containing more than a'
  1357.    say '    set number of lines in the body (default is: no limit)'
  1358.    say '  3 Check for new newsgroups (default is ''don''t check'')'
  1359.    say '  4 Default all three of the above.'
  1360.    say '  5 When done, must press 5 to exit this screen'
  1361.    do until pos(opts,'12345') \= 0
  1362.       say ''
  1363.       prompt = 'Select 1, 2, 3, 4, or 5:'
  1364.       say prompt
  1365.          parse value SysCurPos() with row col
  1366.          row  = row - 1
  1367.          col = length(prompt) + 2
  1368.          call SysCurPos row, col
  1369.       opts = SysGetKey('NOECHO')
  1370.    end
  1371.    
  1372.    select
  1373.       when opts = 1 then call max_news_packet
  1374.       when opts = 2 then call max_news_lines
  1375.       when opts = 3 then call check_for_new_newsgrps
  1376.       when opts = 4 then
  1377.          do
  1378.             option1 = ''
  1379.             option2 = ''
  1380.             option3 = ''
  1381.             say ''
  1382.             say 'Accepting defaults for all three options'
  1383.             say ''
  1384.             say ''
  1385.             say 'Press any key to continue'
  1386.             call SysGetKey 'NOECHO'
  1387.          end
  1388.       otherwise NOP
  1389.    end
  1390.  
  1391.    getnews_xtra_options = option1 option2
  1392.    getnews_xtra_options = strip(getnews_xtra_options, 'B')
  1393.    getnews_xtra_options = getnews_xtra_options option3
  1394.    getnews_xtra_options = strip(getnews_xtra_options, 'B')
  1395.  
  1396.    getmail_xtra_options = ''            /* We don't set any of these */
  1397. end
  1398. say ''
  1399. say ''
  1400. say ''
  1401. say 'Done setting options for souper.  Looks like:'
  1402. say 'GETMAIL:  souper.exe' souper_getmail_std_options getmail_xtra_options
  1403. say 'GETNEWS:  souper.exe' souper_getnews_std_options getnews_xtra_options
  1404. say 'SENDING:  souper.exe' souper_send_std_options send_xtra_options
  1405. say ''
  1406. say ''
  1407. say 'Press any key to continue'
  1408. call SysGetKey 'NOECHO'
  1409. RETURN
  1410.  
  1411. /*
  1412. =========================
  1413. max_news_packet()
  1414.  
  1415. Default is a packet-size of 2048 kB (2.048 Megs)
  1416. =========================
  1417. */
  1418. max_news_packet:
  1419.      do until datatype(option1, 'W')
  1420.          call SysCls
  1421.          say ''
  1422.          say 'Enter a number in kilobytes for maximum news packet size.'
  1423.          say '2048 is typical. 0 sets packet size to unlimited.'
  1424.          say ''
  1425.          prompt = 'Enter number of kilobytes now:'
  1426.          say prompt
  1427.          parse value SysCurPos() with row col
  1428.          row  = row - 1
  1429.          col = length(prompt) + 2
  1430.          call SysCurPos row, col
  1431.          pull option1
  1432.          if \DataType(option1, 'W') then say 'Must be whole number or zero.'
  1433.      end
  1434.      say ''
  1435.      say 'Maximum packet size for news is set to' option1 'kilobytes'
  1436.      option1 = '-k' option1
  1437.      say ''
  1438.      say ''
  1439.      say 'Press any key to continue'
  1440.      call SysGetKey 'NOECHO'
  1441. RETURN
  1442.  
  1443. /*
  1444. =========================
  1445. max_news_lines()
  1446.  
  1447. Default is no limit.  Because of spamming of
  1448. news articles with attached binaries running
  1449. to 10,000 lines or more, you can set a limit.
  1450. I use 500, myself.
  1451. =========================
  1452. */
  1453. max_news_lines:
  1454.       call SysCls
  1455.       do until datatype(option2, 'W')
  1456.          say ''
  1457.          say 'Do not retrieve articles with more than this many lines'
  1458.          say 'in the body of the article.  Enter 0 for unlimited (the'
  1459.          say 'usual default for souper).'
  1460.          say ''
  1461.          prompt = 'How many lines is the maximum acceptable?'
  1462.          say prompt
  1463.          parse value SysCurPos() with row col
  1464.          row  = row - 1
  1465.          col = length(prompt) + 2
  1466.          call SysCurPos row, col
  1467.          pull option2
  1468.          if \DataType(option2, 'W') then say 'Must be whole number or zero.'
  1469.      end
  1470.      say ''
  1471.      say 'News article not retrieved if over' option2 'lines'
  1472.      if option2 = 0 then option2 = ''
  1473.         else option2 = '-l' option2
  1474.      say ''
  1475.      say ''
  1476.      say 'Press any key to continue'
  1477.      call SysGetKey 'NOECHO'
  1478. RETURN
  1479.  
  1480. /*
  1481. =========================
  1482. check_for_new_newsgrps()
  1483.  
  1484. 'Y' adds new ones to your newsrc file but inactivated
  1485. until you remove the 'inactivate' character.  Default
  1486. is 'N'
  1487. =========================
  1488. */
  1489. check_for_new_newsgrps:
  1490.       do until pos(option3, 'YN') \= 0
  1491.       call SysCls
  1492.          say ''
  1493.          say 'Do you want to check for new news groups and have them added'
  1494.          say 'to your newsrc file (but set as inactive until you activate them)?'
  1495.          prompt = 'Enter Y or N:'
  1496.          say ''
  1497.          say prompt
  1498.          parse value SysCurPos() with row col
  1499.          row  = row - 1
  1500.          col = length(prompt) + 2
  1501.          call SysCurPos row, col
  1502.          parse upper pull option3
  1503.       end
  1504.    say ''
  1505.    if option3 = 'Y' then
  1506.       do
  1507.          option3 = '-a'
  1508.          say 'You elected to add new news groups to your newsrc'
  1509.       end
  1510.    else
  1511.       do
  1512.          option3 = ''
  1513.          say 'You elected not to add new news groups to your newsrc'
  1514.       end
  1515.    say ''
  1516.    say ''
  1517.    say 'Press any key to continue'
  1518.    call SysGetKey 'NOECHO'
  1519. RETURN
  1520.  
  1521. /*
  1522. ==============================================
  1523. Almost done.  No changes to system yet.  Do
  1524. we want to quit before copying files?
  1525. ==============================================
  1526. */
  1527.  
  1528. chance_to_quit:
  1529. call SysCls
  1530. say ''
  1531. say 'WE ARE NOW READY TO COPY FILES...'
  1532. say ''
  1533. say 'Up till now, no changes have been made to your system.'
  1534. say ''
  1535. say 'We will complete installation by creating' ydparms_dat ||','
  1536. say 'by copying other necessary files to your' home 'directory,'
  1537. say 'and by creating some ReXX utility files which we save to'
  1538. say 'the' home 'directory.'
  1539. say ''
  1540. say 'We will create'
  1541. say '   A sub-directory named INCOMING in the' home
  1542. say '   directory (if one already exists, it is left unchanged).'
  1543. say ''
  1544. say '   A Folder Object on the Desktop containing objects for YARNDIAL'
  1545. say '   and for several utilities including one for starting up YARN.'
  1546. say ''
  1547. say 'No other changes are made to your system.'
  1548. say ''
  1549. say 'To quit without completing installation, press Escape.'
  1550. say ''
  1551. say 'Otherwise PRESS ANY OTHER KEY TO COMPLETE INSTALLATION.'
  1552. if SysGetKey('NOECHO') = Escape then
  1553.    do
  1554.       call SysCls
  1555.       say ''
  1556.       say 'Aborting without copying files to' HOME
  1557.       say 'or creating' ydparms_dat 'or creating the'
  1558.       say 'sub-directory INCOMING.'
  1559.       say ''
  1560.       say 'No changes were made to your system.'
  1561.       signal goodbye
  1562.    end
  1563. RETURN
  1564.  
  1565. /*
  1566. ==============================================
  1567. Write the YD_PARMS.DAT file to the yarn home
  1568. directory to which we are installing YarnDial.
  1569. This has all the data Yarndial needs to be
  1570. able to run from (for) that Yarn user
  1571. installation.
  1572. ==============================================
  1573. */
  1574. output_dat:
  1575. home_drive
  1576. 'cd' home
  1577.  
  1578. encry:
  1579. if encrypt then
  1580.    do
  1581.       adv_password = candidate
  1582.    end
  1583. o21 = '! *+"''-/,#$%&().0123456789:;<=>?'
  1584. o22 = '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^'
  1585. o23 = '_`abcdefghijklmnopqrstuvwxyz{|}~'
  1586. e21 = 'u *+"''-/,MI($kU<HgW[_A5%~2Fh3`LO'
  1587. e22 = 't?K^l0jJP{98xBadb1nZimRw=y\Y]4}'
  1588. e23 = 'E>;67V@vS:C.sNGz|cefQ&pq)Tor!#XD'
  1589. adv_password = translate(adv_password, o21||o22||o23, e21||e22||e23)
  1590. if encrypt then
  1591. do
  1592.    say ''
  1593.    our_dir = directory()    /* Where we are executing this pgm from */
  1594.    leng = length(adv_password)
  1595.    call SysFileDelete our_dir || '\word.$$$'
  1596.    DL1 = 'encrypted=' || adv_password,
  1597.    || crlf || 'Encrypted text is the' leng 'character string to the',
  1598.    || crlf || 'right of the FIRST equals sign in encrypted=' || crlf,
  1599.    || crlf || 'Be careful to select only those those' leng 'characters.',
  1600.    || crlf || 'for cutting-and-pasting.' || crlf
  1601.    DL2 = 'Do not be concerned if there is more than one equals',
  1602.    || crlf || 'sign, since characters may have been legitimately',
  1603.    || crlf || 'encoded to equals signs.',
  1604.    || crlf || '',
  1605.    || crlf || 'Remember to Erase' our_dir || '\word.$$$ when done.' 
  1606.    say DL1
  1607.    say 'That line is also stored as ASCII text in'
  1608.    say our_dir || '\word.$$$ for cutting-and-pasting.'
  1609.    say ''
  1610.    say DL2
  1611.    call lineout our_dir || '\word.$$$', DL1
  1612.    call lineout our_dir || '\word.$$$', DL2
  1613.    call stream our_dir || '\word.$$$', 'c', 'close'
  1614.    RETURN
  1615. end
  1616. PWD = translate(PWD, o21||o22||o23, e21||e22||e23)
  1617. POP_PWD = translate(POP_PWD, o21||o22||o23, e21||e22||e23)
  1618.  
  1619. parse var ydparms_dat dat '.' ext
  1620. if stream(ydparms_dat, 'c', 'query exists') \= '',
  1621.    then 'copy' ydparms_dat dat || '.bak'
  1622.  
  1623. call SysFileDelete ydparms_dat
  1624.          /* Output everything to file    */
  1625. call data    /* Read in the text to be output */
  1626. call lineout ydparms_dat, dataline0
  1627. if connection_type = 5 then call lineout ydparms_dat, dataline1
  1628. call lineout ydparms_dat, dataline2
  1629. call stream ydparms_dat, 'c', 'close'
  1630. yd_parms_dat = translate(ydparms_dat)
  1631. say ydparms_dat 'created/updated.'
  1632. say ''
  1633. RETURN
  1634.  
  1635. /*
  1636. ==============================================
  1637. A dataline which is output and becomes the
  1638. YD_PARMS.DAT data file.
  1639.  
  1640. Be very careful editing this.  These are long data
  1641. lines being continued with commas.  Make sure
  1642. every line but the last has comma at its end for each
  1643. of the three dataline statements.
  1644. ==============================================
  1645. */
  1646. DATA:
  1647.  
  1648. dataline0 = '#' ydparms_dat 'created/updated' Date() Time(),
  1649. || crlf || '#',
  1650. || crlf || '#    Edit with any ASCII text editor such as the OS/2 System Editor'
  1651.  
  1652. dataline1 = '#',
  1653. || crlf || '#    Created by installing YARNDIAL for connection_type = 5',
  1654. || crlf || '#    (Requires Manual Configuration)',
  1655. || crlf || '#    Where right-hand side of an equals sign is bracketed with **''s:',
  1656. || crlf || '#    Replace all of what is to right of equals sign with your info.',
  1657. || crlf || '#    if in doubt about adv_password, PWD and POP_PWD try replacing',
  1658. || crlf || '#    any of the three you are not sure of with the encrypted POP_PWD'
  1659.  
  1660. dataline2 = '#    The # sign at the very beginning of a line comments out that line',
  1661. || crlf || '#',
  1662. || crlf || '# These are your Yarn %Home% and %Yarn% directories',
  1663. || crlf || 'HOME=' || home,
  1664. || crlf || 'YARN=' || yarn,
  1665. || crlf || '#',
  1666. || crlf || '# ABOUT THE SEVEN CONNECTION_TYPE CHOICES:',
  1667. || crlf || '#   1 Installed for Advantis via IAK Dialer',
  1668. || crlf || '#   2 Installed for Dial-Other-Internet-Providers (SLIPPM.EXE)',
  1669. || crlf || '#     (connection can be by SLIP or PPP).',
  1670. || crlf || '#   3 Installed for use of a slip.exe or ppp.exe or some other',
  1671. || crlf || '#     dialup string which uses SLIP.EXE or PPP.EXE.',
  1672. || crlf || '#   4 Installed for IN-JOY dialer.',
  1673. || crlf || '#     Requires configuring SLIPPM first (Dial-Other-Internet-Providers)',
  1674. || crlf || '#   5 You chose to manually edit this to complete the configuration',
  1675. || crlf || '#   6 Pot-Luck:  Tries to use any connection that happens to be.',
  1676. || crlf || '#     established.  Connection must be made BEFORE you start YarnDial.',
  1677. || crlf || '#     For connection_type 6, you must run YDINSTL.CMD first for',
  1678. || crlf || '#     connection_type 1,2,3, or 4 and then after installation edit',
  1679. || crlf || '#     connection_type in this file to 6.  See YD.DOC for more',
  1680. || crlf || '#     information.',
  1681. || crlf || '#   7 Like 6, but does not check for a connection, and uses the string',
  1682. || crlf || '#     in dialup_string to dial.',
  1683. || crlf || '#   Anything but 1-7 for connection_type creates an error condition.',
  1684. || crlf || '#',
  1685. || crlf || 'connection_type=' || connection_type,
  1686. || crlf || '#',
  1687. || crlf || '# ABOUT DIALUP_STRING:',
  1688. || crlf || '#   If you plan to use a ppp.exe or slip.exe or other dialup string',
  1689. || crlf || '#   which uses either SLIP.EXE or PPP.EXE to make the connection,',
  1690. || crlf || '#   enter it below if it has not automatically been entered.',
  1691. || crlf || '#   Then change connection_type above to 3. Read' YD_DOC 'for further',
  1692. || crlf || '#   information.',
  1693. || crlf || '#   YARNDIAL executes dialup_string as the evaluated expression:',
  1694. || crlf || '#      interpret dialup_string',
  1695. || crlf || '#   What you enter for dialup_string should consist of ''start'' plus',
  1696. || crlf || '#   the dialer executable such as ppp.exe, slippm.exe, etc., plus any',
  1697. || crlf || '#   arguments.  Omit the word interpret but always include ''start''.',
  1698. || crlf || '#      Example:      ''start slippm.exe MyProvider''',   
  1699. || crlf || '#      or, if you had set tcpos2ini_app=MyProvider in this file',
  1700. || crlf || '#      you can use   ''start'' slippm.exe tcpos2ini_app', 
  1701. || crlf || '#',
  1702. || crlf || 'dialup_string=' || dialup_string,  
  1703. || crlf || '#',
  1704. || crlf || '#',
  1705. || crlf || '# Depending upon what compress and uncompress utilities you use',
  1706. || crlf || '# you may need to edit zip_exe= and unzip_exe=  below (use full paths)',
  1707. || crlf || '#                       Samples:',
  1708. || crlf || '#       OS/2 InfoZip compress/uncompress programs:',
  1709. || crlf || '#          zip_exe=d:\pk_unpk\zip201c2\zip.exe -0m',
  1710. || crlf || '#          unzip_exe=d:\pk_unpk\unz512x2\unzip.exe -o',
  1711. || crlf || '#',
  1712. || crlf || '#       MS-DOS PkWare compress/uncompress programs:',
  1713. || crlf || '#          zip_exe=cmd.exe /c c:\path\pkzip -m -u -o',
  1714. || crlf || '#          unzip_exe=cmd.exe /c c:\path\pkunzip -o',
  1715. || crlf || '# Using another compress/uncompress set?  Refer to' yd_doc || '.',
  1716. || crlf || '# For any MSDOS based ones, you must use  cmd.exe /c  to call them',
  1717. || crlf || '# as shown for the PkWare examples',
  1718. || crlf || '#',
  1719. || crlf || 'zip_exe=' || zip_exe,
  1720. || crlf || 'unzip_exe=' || unzip_exe,
  1721. || crlf || '#',
  1722. || crlf || '# reply_packet is what you have in YARN''s CONFIG file for reply-packet',
  1723. || crlf || 'reply_packet=' || reply_packet,
  1724. || crlf || '# host is the domain in YARN''s CONFIG file',
  1725. || crlf || 'host=' || host,
  1726. || crlf || 'souper_exe=' || souper_exe, 
  1727. || crlf || 'yarn_exe=' || yarn_exe, 
  1728. || crlf || 'import_exe=' || import_exe, 
  1729. || crlf || 'export_exe=' || export_exe, 
  1730. || crlf || 'expire_exe=' || expire_exe, 
  1731. || crlf || 'rebuild_exe=' || rebuild_exe,
  1732. || crlf || 'go_exe=' || go_exe,
  1733. || crlf || 'killjoy_exe=' || killjoy_exe,
  1734. || crlf || '#',
  1735. || crlf || '# You can modify the runtime options for souper.exe by editing these',
  1736. || crlf || '# Read over' yd_doc 'and the souper documentation before doing so.',
  1737. || crlf || '#    DO NOT change the ones indicated as _std_ , especially, DO NOT',
  1738. || crlf || '#    remove the -i''s.  Reason: we read our set up variables from this file',
  1739. || crlf || '#    and not from the TCP-IP settings notebooks when we run the souper',
  1740. || crlf || '#    program.  Keep in mind we got those variables from those sources',
  1741. || crlf || '#    when we ran YDINSTL.CMD to create this parameters file.',
  1742. || crlf || '#',
  1743. || crlf || 'souper_getmail_std_options=' || souper_getmail_std_options,
  1744. || crlf || 'souper_getnews_std_options=' || souper_getnews_std_options,
  1745. || crlf || 'souper_send_std_options=' || souper_send_std_options,
  1746. || crlf || 'getmail_xtra_options=' || getmail_xtra_options,
  1747. || crlf || 'getnews_xtra_options=' || getnews_xtra_options,
  1748. || crlf || 'send_xtra_options=' || send_xtra_options,
  1749. || crlf || '#',
  1750. || crlf || '#',
  1751. || crlf || '# wait is a dialer timeout, in seconds',
  1752. || crlf || 'wait=' || wait, 
  1753. || crlf || '#',
  1754. || crlf || '#    The following is the name of the Dial-Other-Internet-Providers',
  1755. || crlf || '#    app in TCPOS2.INI for connection_type 2 and 3 installations',
  1756. || crlf || 'tcpos2ini_app=' || tcpos2ini_app,
  1757. || crlf || '#',
  1758. || crlf || '#   Parms extracted from the DIALER.INI file',
  1759. || crlf || '#',
  1760. || crlf || 'user=' || user,
  1761. || crlf || 'adv_account=' || adv_account,
  1762. || crlf || 'adv_popserver=' || adv_popserver,
  1763. || crlf || 'adv_newsserver=' || adv_newsserver,
  1764. || crlf || 'adv_password=' || adv_password,
  1765. || crlf || '# The SMTP server (the Gateway):',
  1766. || crlf || 'adv_smtpserver=' || adv_smtpserver,
  1767. || crlf ||'ASK=' ||ASK,
  1768. || crlf ||'GS=' ||GS,
  1769. || crlf ||'WS=' ||WS,
  1770. || crlf ||'DN1=' ||DN1,
  1771. || crlf ||'DN2=' ||DN2,
  1772. || crlf ||'IS1=' ||IS1,
  1773. || crlf ||'IS2=' ||IS2,
  1774. || crlf ||'RS1=' ||RS1,
  1775. || crlf ||'RS2=' ||RS2,
  1776. || crlf ||'FS1=' ||FS1,
  1777. || crlf ||'FS2=' ||FS2,
  1778. || crlf ||'MD=' ||MD,
  1779. || crlf ||'PIN=' ||PIN,
  1780. || crlf ||'EMI=' ||EMI,
  1781. || crlf || '#',
  1782. || crlf || '#   Parms extracted (mostly) from the TCPOS2.INI file',
  1783. || crlf || '#',
  1784. || crlf ||'PROVIDER=' || PROVIDER,
  1785. || crlf ||'LOGIN_ID=' || LOGIN_ID,
  1786. || crlf ||'PWD=' || PWD,
  1787. || crlf ||'SAVE_PWD=' || SAVE_PWD,
  1788. || crlf ||'PHONE_NUMBER=' || PHONE_NUMBER,
  1789. || crlf ||'HANGUP=' || HANGUP,
  1790. || crlf ||'SCRIPT=' || SCRIPT,
  1791. || crlf ||'SERVICE=' || SERVICE,
  1792. || crlf ||'YOURIP=' || YOURIP,
  1793. || crlf ||'DESTIP=' || DESTIP,
  1794. || crlf ||'NETMASK=' || NETMASK,
  1795. || crlf ||'MTU_SIZE=' || MTU_SIZE,
  1796. || crlf ||'VJ_COMP=' || VJ_COMP,
  1797. || crlf ||'HOSTNAME=' || HOSTNAME,
  1798. || crlf ||'DOMAIN_NAME=' || DOMAIN_NAME,
  1799. || crlf ||'DNS=' || DNS,
  1800. || crlf ||'DEFAULT_NEWS=' || DEFAULT_NEWS,
  1801. || crlf ||'DEFAULT_WWW=' || DEFAULT_WWW,
  1802. || crlf ||'DEFAULT_GOPHER=' || DEFAULT_GOPHER,
  1803. || crlf ||'MAIL_GW=' || MAIL_GW,
  1804. || crlf ||'POPSRVR=' || POPSRVR,
  1805. || crlf ||'REPLY_DOMAIN=' || REPLY_DOMAIN,
  1806. || crlf ||'REPLY_ID=' || REPLY_ID,
  1807. || crlf ||'POP_ID=' || POP_ID,
  1808. || crlf ||'POP_PWD=' || POP_PWD,
  1809. || crlf ||'MODEM_TYPE=' || MODEM_TYPE,
  1810. || crlf ||'COMPORT=' || COMPORT,
  1811. || crlf ||'BAUD=' || BAUD,
  1812. || crlf ||'DATABITS=' || DATABITS,
  1813. || crlf ||'PARITY=' || PARITY,
  1814. || crlf ||'DIAL_MODE=' || DIAL_MODE,
  1815. || crlf ||'PREFIX=' || PREFIX,
  1816. || crlf ||'PREFIX_ANS=' || PREFIX_ANS,
  1817. || crlf ||'INIT=' || INIT,
  1818. || crlf ||'INIT2=' || INIT2,
  1819. || crlf ||'DISABLE=' || DISABLE,
  1820. || crlf ||'DISABLE_SEQ=' || DISABLE_SEQ,
  1821. || crlf ||'DIAL_PREFIX=' || DIAL_PREFIX,
  1822. || crlf ||'AUTOSTART=' || AUTOSTART,
  1823. || crlf ||'TOTAL_CONNECT=' || TOTAL_CONNECT,
  1824. || crlf ||'#',
  1825. || crlf || '# End of' ydparms_dat    /* No comma at the end of this line */
  1826. RETURN          
  1827.  
  1828. /*
  1829. ==============================================
  1830. copy_ydfiles()
  1831.  
  1832. Copy over files from the installation
  1833. directory to the home directory.  We expect to find the icon
  1834. files in a subdirectory (ICONS) but if you happened to use
  1835. PkWare unzip without the -d option they will not be
  1836. there so we will look for them in the installer's directory
  1837. also to avoid an abortable error.
  1838. ==============================================
  1839. */
  1840. copy_ydfiles:
  1841.  
  1842. /*
  1843. ============================
  1844. Create an incoming subdirectory in the home directory
  1845. if not there already.  This is for use in running souper
  1846. and has nothing to do with completing this installation of
  1847. YarnDial
  1848. ============================
  1849. */
  1850.  
  1851. call SysMkDir home || '\incoming'
  1852.  
  1853. /* But we do need to create an ICONS subdirectory in our target
  1854. home directory as part of the installation */
  1855.  
  1856. call SysMkDir home || '\icons'
  1857.  
  1858. /* get down to filename only, strip and path, arguments */
  1859. yd_cmd = filespec('name', yd_cmd)
  1860. ydinstl_cmd = filespec('name', ydinstl_cmd)
  1861. yarn_ico = filespec('name', yarn_ico)
  1862. yd_doc = filespec('name', yd_doc)
  1863. readme_1st = filespec('name', readme_1st)
  1864. go_exe = filespec('name', go_exe)
  1865. yarn_ico = filespec('name', yarn_ico)
  1866. yarndial_ico = filespec('name', yarndial_ico)
  1867. ydfold1_ico = filespec('name', ydfold1_ico)
  1868. ydfold2_ico = filespec('name', ydfold2_ico)
  1869. yarnshell_ico = yarn_ico
  1870. yarnutil_ico = filespec('name', yarnutil_ico)
  1871. ydinstl_ico = filespec('name', ydinstl_ico)
  1872. logoff_ico = filespec('name', logoff_ico)
  1873. renewzip_ico = filespec('name', renewzip_ico)
  1874.  
  1875. /*
  1876. ============================
  1877. First copy over icons. If they are not in an icons subdirectory
  1878. we look for them in the source directory.  And if they are only in
  1879. an icon subdirectory and the source_path is the same as home, we do
  1880. nothing as we can't copy something over onto itself
  1881.  
  1882. if we try a wildcard copy (copy *.ico) and there are no files to copy, we get an
  1883. error, so we need to have at least one file to copy.  Hence these awful multipart
  1884. conditionals
  1885. ============================
  1886. */
  1887.  
  1888. if home \= source_path then
  1889.    do
  1890.       if stream(source_path || '\icons\' || yarn_ico, 'c', 'query exists') \= '',
  1891.        | stream(source_path || '\icons\' || yarndial_ico, 'c', 'query exists') \= '',
  1892.        | stream(source_path || '\icons\' || ydfold1_ico, 'c', 'query exists') \= '',
  1893.        | stream(source_path || '\icons\' || ydfold2_ico, 'c', 'query exists') \= '',
  1894.        | stream(source_path || '\icons\' || yarnutil_ico, 'c', 'query exists') \= '',
  1895.        | stream(source_path || '\icons\' || ydinstl_ico, 'c', 'query exists') \= '',
  1896.        | stream(source_path || '\icons\' || renewzip_ico, 'c', 'query exists') \= '',
  1897.        | stream(source_path || '\icons\' || logoff_ico, 'c', 'query exists') \= '' then
  1898.             do
  1899.                say 'Copying icon files from' source_path || '\icons to' HOME || '\icons'
  1900.                'copy' source_path || '\icons\' || '*.ico' home || '\icons' 
  1901.             end
  1902.    end
  1903.  
  1904. if stream(source_path || '\' || yarn_ico, 'c', 'query exists') \= '',
  1905.  | stream(source_path || '\' || yarndial_ico, 'c', 'query exists') \= '',
  1906.  | stream(source_path || '\' || ydfold1_ico, 'c', 'query exists') \= '',
  1907.  | stream(source_path || '\' || ydfold2_ico, 'c', 'query exists') \= '',
  1908.  | stream(source_path || '\' || yarnutil_ico, 'c', 'query exists') \= '',
  1909.  | stream(source_path || '\' || ydinstl_ico, 'c', 'query exists') \= '',
  1910.  | stream(source_path || '\' || renewzip_ico, 'c', 'query exists') \= '',
  1911.  | stream(source_path || '\' || logoff_ico, 'c', 'query exists') \= '' then
  1912.    do
  1913.       say 'Copying icon files from' source_path 'to' HOME || '\icons'
  1914.       'copy' source_path || '\' || '*.ico' home || '\icons' 
  1915.    end
  1916.  
  1917.  
  1918.   
  1919. /*
  1920. ============================
  1921. Then copy remaining files to complete the installation.  Again, if we are already
  1922. installing to the home directory and source_path is the home directory instead of
  1923. some other (temporary) one, just exit the routine because files are already where we
  1924. want them
  1925. ============================
  1926. */
  1927.  
  1928. if home = source_path then
  1929.    do
  1930.       nop
  1931.    end
  1932.  
  1933. else
  1934.    do
  1935.       say 'Copying rest of files from' source_path 'to' HOME
  1936.       home_drive
  1937.       'cd' home
  1938.  
  1939.       if stream(source_path || '\' || yd_cmd, 'c', 'query exists') \= '' then
  1940.          do
  1941.             'copy' source_path || '\' || yd_cmd
  1942.             if \SysSetIcon(yd_cmd, home || '\icons\' || yarndial_ico) then
  1943.                say 'unable to set icon for' yd_cmd '(NON-CRITICAL ERROR)'
  1944.          end
  1945.  
  1946.       if stream(source_path || '\' || ydinstl_cmd, 'c', 'query exists') \= ''  then
  1947.          do
  1948.             'copy' source_path || '\' || ydinstl_cmd
  1949.             if \SysSetIcon(ydinstl_cmd, home || '\icons\' || ydinstl_ico) then
  1950.                say 'unable to set icon for' ydinstl_cmd '(NON-CRITICAL ERROR)'         
  1951.          end
  1952.  
  1953.    if stream(source_path || '\' || yd_doc, 'c', 'query exists') \= '' then
  1954.       'copy' source_path || '\' || yd_doc
  1955.  
  1956.    if stream(source_path || '\' || readme_1st, 'c', 'query exists') \= '' then
  1957.       'copy' source_path || '\' || readme_1st
  1958.  
  1959.    if stream(source_path || '\' || go_exe, 'c', 'query exists') \= '' then
  1960.       'copy' source_path || '\' || go_exe
  1961. end /* of else */
  1962.  
  1963. completed = 1
  1964. RETURN
  1965.  
  1966. /*
  1967. =======================================================
  1968. We create  a suite of small REXX programs and save them to the HOME
  1969. directory we are now installing to.  All of these will run with the OS/2
  1970. environment variable, HOME, set using SetLocal() to the unique home
  1971. directory chosen for this particular user installation.
  1972.  
  1973. First we create a program (YRNSHELL.CMD) which starts
  1974. yarn.exe for this particular user installation.
  1975. =======================================================
  1976. */ 
  1977. create_yarnshell_cmd:
  1978. say 'Creating customized .CMD files for the' home 'directory'
  1979. home_drive
  1980. 'cd' home
  1981.  
  1982. yarnshell_cmd = filespec('name', yarnshell_cmd)
  1983.  
  1984. call SysFileDelete yarnshell_cmd
  1985.  
  1986. /* Now create yarnshell_cmd as a .CMD file in the HOME directory */
  1987.  
  1988. dataline = '/*' yarnshell_cmd,
  1989. || crlf || 'Program to start' yarn_exe,
  1990. || crlf || 'Created by YARNDIAL''s' ydinstl_cmd date() time(),
  1991. || crlf || 'Sets' HOME 'as the HOME env. variable',
  1992. || crlf || 'and sets' yarn 'as the YARN env. variable.',
  1993. || crlf || 'Sets working directory to' yarn,
  1994. || crlf || 'Sets OS/2 window to 80 chars x 40 lines   */' || crlf,
  1995. || crlf || 'x = SetLocal()',
  1996. || crlf || '''@echo off''',
  1997. || crlf || 'x = value(''home'', ''' || home || ''', ''OS2ENVIRONMENT'')',
  1998. || crlf || 'x = value(''yarn'', ''' || yarn || ''', ''OS2ENVIRONMENT'')',
  1999. || crlf || home_drive,
  2000. || crlf || '''cd' home || '''',
  2001. || crlf || '''mode co80,40''',
  2002. || crlf || '''' || yarn_exe || '''',
  2003. || crlf || 'x = EndLocal()'
  2004.  
  2005. call lineout yarnshell_cmd, dataline
  2006. call stream yarnshell_cmd, 'c', 'close'
  2007. say '  ' yarnshell_cmd 'created/updated.'
  2008. if \SysSetIcon(yarnshell_cmd, home || '\icons\' || yarn_ico) then
  2009.    say 'unable to set icon for' yarnshell_cmd '(NON-CRITICAL ERROR)'
  2010. RETURN
  2011.  
  2012.  
  2013. /*
  2014. =======================================================
  2015. Create a program (YRNUTIL.CMD) to run yarn utilities for
  2016. this particular user installation.  It temporarily sets
  2017. a variable named home in the the OS/2 environment to the
  2018. home directory chosen for this particular user installation,
  2019. then prompts for the yarn utility to run, then runs it.
  2020. =======================================================
  2021. */ 
  2022.  
  2023. create_yarnutil_cmd:
  2024. home_drive
  2025. 'cd' home
  2026.  
  2027. yarnutil_cmd = filespec('name', yarnutil_cmd)
  2028.  
  2029. call SysFileDelete yarnutil_cmd
  2030.  
  2031. /* Now create yarnutil_cmd as a .CMD file in the HOME directory */
  2032.  
  2033. dataline = '/* */',
  2034. || crlf || 'say ''' || yarnutil_cmd || '''',
  2035. || crlf || 'say ''Program to start a yarn executable.''',
  2036. || crlf || 'say ''Sets' HOME 'as the HOME env. variable''',
  2037. || crlf || 'say ''and sets' yarn 'as the YARN env. variable.''',
  2038. || crlf || 'say ''Sets working directory to' yarn || '''',
  2039. || crlf || 'say ''Created by YARNDIAL''''s' ydinstl_cmd date() time() || '''',
  2040. || crlf || 'say ''''',
  2041. || crlf || '/* Load RexxUtil if not already loaded */',
  2042. || crlf || 'if RxFuncQuery(''SysLoadFuncs'') \= 0 then',
  2043. || crlf || '   do',
  2044. || crlf || '      call RxFuncAdd ''SysLoadFuncs'', ''REXXUTIL'', ''SysLoadFuncs''',
  2045. || crlf || '      call SysLoadFuncs',
  2046. || crlf || '   end',
  2047. || crlf || 'x = SetLocal()',
  2048. || crlf || '''@echo off''',
  2049. || crlf || 'x = value(''home'', ''' || home || ''', ''OS2ENVIRONMENT'')',
  2050. || crlf || 'x = value(''yarn'', ''' || yarn || ''', ''OS2ENVIRONMENT'')',
  2051. || crlf || yarn_drive,
  2052. || crlf || '''cd' yarn || '''',
  2053. || crlf || 'say ''What yarn utility do you want to run?''',
  2054. || crlf || 'prompt = ''Omit the path. Enter:''',
  2055. || crlf || 'say prompt',
  2056. || crlf || 'parse value SysCurPos() with row col',
  2057. || crlf || 'row  = row - 1',
  2058. || crlf || 'col = length(prompt) + 2',
  2059. || crlf || 'call SysCurPos row, col',
  2060. || crlf || 'parse pull yarn_utility',
  2061. || crlf || 'yarn_utility',
  2062. || crlf || 'x = EndLocal()',
  2063. || crlf || 'say ''''',
  2064. || crlf || 'say ''Done.  Press any key to exit...''',        
  2065. || crlf || 'answer = SysGetKey(''NOECHO'')'
  2066.  
  2067. call lineout yarnutil_cmd, dataline
  2068. call stream yarnutil_cmd, 'c', 'close'
  2069. say '  ' yarnutil_cmd 'created/updated.'
  2070. if \SysSetIcon(yarnutil_cmd, home || '\icons\' || yarnutil_ico) then
  2071.    say 'unable to set icon for' yarnutil_cmd '(NON-CRITICAL ERROR)'
  2072. RETURN
  2073.  
  2074. /*
  2075. =======================================================
  2076. Create a logoff program (LOGOFF.CMD).  It determines if
  2077. any of the following are up and running, and if so, closes
  2078. them down: SLIP.EXE, PPP.EXE, DIALER.EXE, SLIPPM.EXE.
  2079. This will work in any environment but we place a copy
  2080. in each home directory we install to (convenient to do so).
  2081.  
  2082. I wanted something like this so if for some reason I was
  2083. logged on and wanted a sure-fire shut-down freeing up my
  2084. phone line, I could do it with one double-click.
  2085.  
  2086. This uses go.exe from GO_15.EXE.  go.exe is supplied with
  2087. this yarndial/installer package.
  2088. =======================================================
  2089. */ 
  2090.  
  2091. create_logoff_cmd:
  2092. home_drive
  2093. 'cd' home
  2094.  
  2095. logoff_cmd = filespec('name', logoff_cmd)
  2096.  
  2097. call SysFileDelete logoff_cmd
  2098.  
  2099. /* Now create logoff_cmd as a .CMD file in the HOME directory */
  2100.  
  2101. dataline = '/* */',
  2102. || crlf || 'say ''' || logoff_cmd || '''',
  2103. || crlf || 'say ''Shutdown of IAK Dialer, SLIP, PPP, SLATTACH, SLIPPM, IN-JOY''',
  2104. || crlf || 'say ''Created by YARNDIAL''''s' ydinstl_cmd date() time() || '''' || crlf,
  2105. || crlf || 'say ''''',
  2106. || crlf || '/* --------  you can edit these 3 things -------- */',
  2107. || crlf || 'go_exe = ''' || go_exe || '''    /* full path to GO_15''s GO.EXE */',
  2108. || crlf || 'killjoy_exe = ''' || killjoy_exe || '''    /* full path toIN-JOY''s KILLJOY.EXE */',
  2109. || crlf || 'settle_time = 10  /* seconds,  settle down before rechecking */' || crlf || crlf,
  2110. || crlf || '/* Load RexxUtil if not already loaded */',
  2111. || crlf || 'if RxFuncQuery(''SysLoadFuncs'') \= 0 then',
  2112. || crlf || '   do',
  2113. || crlf || '      call RxFuncAdd ''SysLoadFuncs'', ''REXXUTIL'', ''SysLoadFuncs''',
  2114. || crlf || '      call SysLoadFuncs',
  2115. || crlf || '   end',
  2116. || crlf || '''@echo off''',
  2117. || crlf || 'call is_process_running ''dialer''',
  2118. || crlf || 'call is_process_running ''slip''',
  2119. || crlf || 'call is_process_running ''ppp''',
  2120. || crlf || 'call is_process_running ''slattach''',
  2121. || crlf || 'call is_process_running ''slippm''' || crlf,
  2122. || crlf || 'if stream(''' || killjoy_exe || ''', ''c'', ''query exists'') \= '''' then',
  2123. || crlf || '   do',
  2124. || crlf || '      ''' || killjoy_exe || '''',
  2125. || crlf || '      call SysSleep 3 /* settle time */',
  2126. || crlf || '   end',
  2127. || crlf || 'call is_process_running ''in-joy''', 
  2128. || crlf || 'say ''Waiting'' settle_time ''secs. before testing them all again...''',
  2129. || crlf || 'call SysSleep settle_time' || crlf,
  2130. || crlf || 'call is_process_running ''dialer''',
  2131. || crlf || 'call is_process_running ''slip''',
  2132. || crlf || 'call is_process_running ''ppp''',
  2133. || crlf || 'call is_process_running ''slattach''',
  2134. || crlf || 'call is_process_running ''slippm''',
  2135. || crlf || 'if stream(''' || killjoy_exe || ''', ''c'', ''query exists'') \= '''' then',
  2136. || crlf || '   do',
  2137. || crlf || '      ''' || killjoy_exe || '''',
  2138. || crlf || '      call SysSleep 3 /* settle time */',
  2139. || crlf || '   end',
  2140. || crlf || 'call is_process_running ''in-joy''', 
  2141. || crlf || 'say ''''',
  2142. || crlf || 'say ''Press any key to exit...''',        
  2143. || crlf || 'answer = SysGetKey(''NOECHO'')',
  2144. || crlf || 'EXIT' || crlf || crlf,
  2145. || crlf || 'is_process_running:',
  2146. || crlf || 'parse upper arg process            /* Check if it is */',
  2147. || crlf || 'go_exe ''-cp'' process ''> NUL''    /* returns RC=1 if process is running, 0 if not */',
  2148. || crlf || 'If RC then',
  2149. || crlf || '   do',
  2150. || crlf || '      say process ''is running''',
  2151. || crlf || '      if process = ''DIALER'' then',
  2152. || crlf || '         do',
  2153. || crlf || '            process ''-c > nul'', /* hope it''s at least v 1.33 */',
  2154. || crlf || '            call SysSleep 3 /* settle time, IAK Dialer is funny */',
  2155. || crlf || '            say ''   If you lost this window for a few seconds or just heard a beep''',
  2156. || crlf || '            say ''   that is normal for closing down certain versions of IAK Dialer''',
  2157. || crlf || '         end',
  2158. || crlf || '   end',
  2159. || crlf || 'else say process ''is not running''',
  2160. || crlf || 'go ''-ka'' process ''> NUL''  /* do a kill whether running or not */',
  2161. || crlf || 'RETURN'
  2162.  
  2163. call lineout logoff_cmd, dataline
  2164. call stream logoff_cmd, 'c', 'close'
  2165. say '  ' logoff_cmd 'created/updated.'
  2166. if \SysSetIcon(logoff_cmd, home || '\icons\' || logoff_ico) then
  2167.    say 'unable to attach icon for' logoff_cmd '(NON-CRITICAL ERROR)'
  2168. RETURN
  2169.  
  2170.  
  2171. /*
  2172. =======================================================
  2173. Create a program (RENEWZIP.CMD) to rename to a .ZIP file
  2174. the reply_packet ZIP file for this user that we had backed
  2175. up as a *.BAK file when last we exported posts and mail.
  2176. If something went wrong with sending/posting, this
  2177. renewzip.cmd restores the .ZIP and allows us a second shot.
  2178. =======================================================
  2179. */ 
  2180.  
  2181. create_renewzip_cmd:
  2182. home_drive
  2183. 'cd' home
  2184. renewzip_cmd = filespec('name', renewzip_cmd)
  2185. parse var renewzip_cmd renewzip '.' ext
  2186. call SysFileDelete renewzip_cmd
  2187.  
  2188. reply_packet = translate(reply_packet)
  2189.  
  2190. parse var reply_packet reply '.' ext
  2191. reply_bak = reply || '.BAK'
  2192. reply_asterisk = reply || '.*'
  2193.  
  2194. /* Now create renewzip_cmd as a .CMD file in the HOME directory */
  2195.  
  2196. dataline = '/* */',
  2197. || crlf || 'say ''' || renewzip_cmd || '''',
  2198. || crlf || 'say ''Restores' reply_packet 'by renaming the *.BAK to *.ZIP''',
  2199. || crlf || 'say ''Created by YARNDIAL''''s' ydinstl_cmd date() time() || '''',
  2200. || crlf || 'say ''DIR run below should confirm restoration of the *.ZIP''',
  2201. || crlf || 'say ''''',
  2202. || crlf || '/* Load RexxUtil if not already loaded */',
  2203. || crlf || 'if RxFuncQuery(''SysLoadFuncs'') \= 0 then',
  2204. || crlf || '   do',
  2205. || crlf || '      call RxFuncAdd ''SysLoadFuncs'', ''REXXUTIL'', ''SysLoadFuncs''',
  2206. || crlf || '      call SysLoadFuncs',
  2207. || crlf || '   end',
  2208. || crlf || '''@echo off''',
  2209. || crlf || 'if stream(''' || reply_bak || ''', ''c'', ''query exists'') \= '''' then',
  2210. || crlf || '   do',
  2211. || crlf || '      ''copy' reply_bak reply_packet || '''',
  2212. || crlf || '      ''dir' reply_asterisk || '''',
  2213. || crlf || '   end',
  2214. || crlf || 'else say ''no' reply_bak 'to restore''',
  2215. || crlf || 'say ''''',
  2216. || crlf || 'say ''Press any key to exit...''',        
  2217. || crlf || 'answer = SysGetKey(''NOECHO'')'
  2218.  
  2219. call lineout renewzip_cmd, dataline
  2220. call stream renewzip_cmd, 'c', 'close'
  2221. say '  ' renewzip_cmd 'created/updated.'
  2222. if \SysSetIcon(renewzip_cmd, home || '\icons\' || renewzip_ico) then
  2223.    say 'unable to attach icon for' renewzip_cmd '(NON-CRITICAL ERROR)'
  2224. RETURN
  2225.  
  2226. /*
  2227. ==============================================
  2228. create_yarndial_objects()
  2229.  
  2230. Create a folder on the desktop uniquely named for
  2231. our user installation.  Into it place our objects also named
  2232. to identify them with the specific home directory for which
  2233. this installation was done.
  2234. ==============================================
  2235. */
  2236. create_yarndial_objects:
  2237.  
  2238. say 'Creating Desktop Folder object and its Program objects'
  2239.  
  2240. /* First create a Desktop Folder object for our YARNDIAL objects */
  2241.  
  2242. object_creation_error = 0    /* if an error, we set to 1 */
  2243.  
  2244. home = translate(home, Lowcase, Upcase)   /* to lower case */
  2245.  
  2246. classname = 'WPFolder'
  2247. folder_fore_title ='YarnDial Suite for' 
  2248. title = folder_fore_title || '^' || home
  2249. location = '<WP_DESKTOP>'
  2250. desktop_folder_object_id = '<' || title || '>'
  2251. iconfile = home || '\icons\' || ydfold1_ico    /* Animated folder icon (closed folder) */
  2252. iconnfile = home || '\icons\' || ydfold2_ico    /* Animated folder icon (open folder) */
  2253. startupdir = home
  2254. setup = 'OBJECTID=' || desktop_folder_object_id ||,
  2255.          ';ALWAYSSORT=YES' ||,
  2256.          ';ICONFILE=' || iconfile ||,
  2257.          ';ICONNFILE=1,' iconnfile
  2258.  
  2259. if \SysCreateObject(classname, title, location, setup, 'U') then
  2260.    do
  2261.       say 'YARNDIAL FOLDER object creation unsuccessful'
  2262.       object_creation_error = 1
  2263.    end
  2264. else
  2265.   DO
  2266.       say '   YARNDIAL FOLDER object created/updated successfully'
  2267.  
  2268. /* Folder created successfully? Then create all the program objects
  2269. and place them in the folder */
  2270.  
  2271. /* The desktop folder we just created is located at... */
  2272. location = desktop_folder_object_id   /* location for the rest is in the folder */
  2273.  
  2274. /* Create the object for YarnDial */
  2275.    classname = 'WPProgram'
  2276.    title = 'YarnDial for^' || home
  2277.    exename = home || '\' || yd_cmd
  2278.    iconfile = home || '\icons\' || yarndial_ico
  2279.    startupdir = home
  2280.  
  2281.    setup = 'OBJECTID=<' || title || '>' ||,
  2282.             ';ICONFILE=' || iconfile ||,
  2283.             ';EXENAME=' || exename ||,
  2284.             ';STARTUPDIR=' || startupdir
  2285.  
  2286.    if SysCreateObject(classname, title, location, setup, 'U') then
  2287.       do
  2288.          say '   YARNDIAL object created/updated successfully'
  2289.       end
  2290.    else
  2291.       do
  2292.          say 'YARNDIAL object creation unsuccessful'
  2293.          object_creation_error = 1
  2294.       end
  2295.  
  2296. /* and then do all of this until the end of the subroutine... */
  2297.  
  2298. /* Create an object for yarnshell_cmd */
  2299.    title = 'YARN Program for^' || home 
  2300.    exename = home || '\' || yarnshell_cmd
  2301.    iconfile = home || '\icons\' || yarn_ico
  2302.    startupdir = home
  2303.  
  2304.    setup = 'OBJECTID=<' || title || '>' ||,
  2305.             ';ICONFILE=' || iconfile ||,
  2306.             ';EXENAME=' || exename ||,
  2307.             ';STARTUPDIR=' || startupdir
  2308.  
  2309.    if SysCreateObject(classname, title, location, setup, 'U') then
  2310.       do
  2311.          say '  ' YARNSHELL_CMD 'object created/updated successfully'
  2312.       end
  2313.    else
  2314.       do
  2315.          say 'YRNSHELL object creation unsuccessful'
  2316.          object_creation_error = 1
  2317.       end
  2318.  
  2319. /* Create an object for yarnutil_cmd */
  2320.    title = 'YarnUtil from^' || home
  2321.    exename = home || '\' || yarnutil_cmd
  2322.    iconfile = home || '\icons\' || yarnutil_ico
  2323.    startupdir = home
  2324.  
  2325.    setup = 'OBJECTID=<' || title || '>' ||,
  2326.             ';ICONFILE=' || iconfile ||,
  2327.             ';EXENAME=' || exename ||,
  2328.             ';STARTUPDIR=' || startupdir
  2329.  
  2330.    if SysCreateObject(classname, title, location, setup, 'U') then
  2331.       do
  2332.          say '  ' YARNUTIL_CMD 'object created/updated successfully'
  2333.       end
  2334.    else
  2335.       do
  2336.          say 'YRNUTIL object creation unsuccessful'
  2337.          object_creation_error = 1
  2338.       end
  2339.  
  2340. /* Create an object for logoff_cmd */
  2341.    title = 'Logoff running from^' || home
  2342.    exename = home || '\' || logoff_cmd
  2343.    iconfile = home || '\icons\' || logoff_ico
  2344.    startupdir = home
  2345.  
  2346.    setup = 'OBJECTID=<' || title || '>' ||,
  2347.             ';ICONFILE=' || iconfile ||,
  2348.             ';EXENAME=' || exename ||,
  2349.             ';STARTUPDIR=' || startupdir
  2350.  
  2351.    if SysCreateObject(classname, title, location, setup, 'U') then
  2352.       do
  2353.          say '  ' LOGOFF_CMD 'object created/updated successfully'
  2354.       end
  2355.    else
  2356.       do
  2357.          say 'LOGOFF object creation unsuccessful'
  2358.          object_creation_error = 1
  2359.      end
  2360.  
  2361. /* Create an object for renewzip_cmd */
  2362.    title = 'Reply Zip Restorer for^' || translate(reply_packet, Lowcase, Upcase) /* to lower case */ 
  2363.    exename = home || '\' || renewzip_cmd
  2364.    iconfile = home || '\icons\' || renewzip_ico
  2365.    startupdir = home
  2366.  
  2367.    setup = 'OBJECTID=<' || title || '>' ||,
  2368.             ';ICONFILE=' || iconfile ||,
  2369.             ';EXENAME=' || exename ||,
  2370.             ';STARTUPDIR=' || startupdir
  2371.  
  2372.    if SysCreateObject(classname, title, location, setup, 'U') then
  2373.       do
  2374.          say '  ' RENEWZIP_CMD 'object created/updated successfully'
  2375.       end
  2376.    else
  2377.       do
  2378.          say 'RENEWZIP object creation unsuccessful'
  2379.          object_creation_error = 1
  2380.       end
  2381. END    /* creating program objects in the Desktop Folder we created */
  2382. RETURN
  2383.  
  2384. /*
  2385. =======================================================
  2386. recreate_objects_cmd()
  2387. Create a program (OBJECTS.CMD) to to be able to recreate the
  2388. YarnDial Desktop folder and objects in it.
  2389. =======================================================
  2390. */ 
  2391.  
  2392.  
  2393. recreate_objects_cmd:
  2394. /* Now create objects_cmd as a .CMD file in the HOME directory */
  2395. home_drive
  2396. 'cd' home
  2397. call SysFileDelete objects_cmd
  2398. say 'Creating a program to be able to recreate the YarnDial'
  2399. say 'desktop folder for this installation, and all of its objects'
  2400.  
  2401. dataline = '/*' || objects_cmd || '*/',
  2402. || crlf || 'say ''Created by YARNDIAL''''s' ydinstl_cmd date() time() || '''' || crlf,
  2403. || crlf || 'say ''Re-creates a Desktop Folder object and its Program objects''',
  2404. || crlf || 'say ''for the user whose HOME directory is'' translate(''' || home || ''')',
  2405. || crlf || 'say ''''' || crlf,
  2406. || crlf || '/* Load RexxUtil if not already loaded */',
  2407. || crlf || 'if RxFuncQuery(''SysLoadFuncs'') \= 0 then',
  2408. || crlf || '   do',
  2409. || crlf || '      call RxFuncAdd ''SysLoadFuncs'', ''REXXUTIL'', ''SysLoadFuncs''',
  2410. || crlf || '      call SysLoadFuncs',
  2411. || crlf || '   end' || crlf,
  2412. || crlf || 'say ''Press any key to continue.  CTRL-C quits.''',
  2413. || crlf || 'answer = SysGetKey(''NOECHO'')' || crlf,
  2414. || crlf || 'say ''''' || crlf,
  2415. || crlf || '/* First create a Desktop Folder object for our YARNDIAL objects */' ,
  2416. || crlf || 'object_creation_error = 0    /* if an error, we set to 1 */' || crlf,
  2417. || crlf || 'Upcase = xrange(''A'', ''Z'')',
  2418. || crlf || 'Lowcase = xrange(''a'', ''z'')' || crlf,
  2419. || crlf || 'home = translate(''' || home || ''', Lowcase, Upcase)' || crlf,
  2420. || crlf || 'classname = ''WPFolder''',
  2421. || crlf || 'folder_fore_title =''YarnDial Suite for''', 
  2422. || crlf || 'title = folder_fore_title || ''^'' || home',
  2423. || crlf || 'location = ''<WP_DESKTOP>''',
  2424. || crlf || 'desktop_folder_object_id = ''<'' || title || ''>''',
  2425. || crlf || 'iconfile = home || ''\icons\' || ydfold1_ico || '''    /* Animated folder icon (closed folder) */',
  2426. || crlf || 'iconnfile = home || ''\icons\' || ydfold2_ico || '''    /* Animated folder icon (open folder) */',
  2427. || crlf || 'startupdir = home',
  2428. || crlf || 'setup = ''OBJECTID='' || desktop_folder_object_id ||,',
  2429. || crlf || '         '';ALWAYSSORT=YES'' ||,',
  2430. || crlf || '         '';ICONFILE='' || iconfile ||,',
  2431. || crlf || '         '';ICONNFILE=1,'' iconnfile' || crlf,
  2432. || crlf || 'if \SysCreateObject(classname, title, location, setup, ''U'') then',
  2433. || crlf || '   do',
  2434. || crlf || '      say ''YARNDIAL FOLDER object creation unsuccessful''',
  2435. || crlf || '      object_creation_error = 1',
  2436. || crlf || '   end',
  2437. || crlf || 'else',
  2438. || crlf || '   do',
  2439. || crlf || '      say ''YARNDIAL FOLDER object created/updated successfully''' || crlf,
  2440. || crlf || '/* Folder created successfully? Then create all the program objects',
  2441. || crlf || 'and place them in the folder */' || crlf,
  2442. || crlf || '/* The desktop folder we just created is located at... */',
  2443. || crlf || 'location = desktop_folder_object_id    /* location for the rest is in the folder */' || crlf,
  2444. || crlf || '/* Create the object for YarnDial */',
  2445. || crlf || '   classname = ''WPProgram''',
  2446. || crlf || '   title = ''YarnDial for^'' || home',
  2447. || crlf || '   exename = home || ''\' || yd_cmd || '''',
  2448. || crlf || '   iconfile = home || ''\icons\' || yarndial_ico || '''',
  2449. || crlf || '   startupdir = home' || crlf,
  2450. || crlf || '   setup = ''OBJECTID=<'' || title || ''>'' ||,',
  2451. || crlf || '            '';ICONFILE='' || iconfile ||,',
  2452. || crlf || '            '';EXENAME='' || exename ||,',
  2453. || crlf || '            '';STARTUPDIR='' || startupdir' || crlf,
  2454. || crlf || '   if SysCreateObject(classname, title, location, setup, ''U'') then',
  2455. || crlf || '      do' ,
  2456. || crlf || '         say ''YARNDIAL object created/updated successfully''',
  2457. || crlf || '      end',
  2458. || crlf || '   else',
  2459. || crlf || '      DO',
  2460. || crlf || '         say ''YARNDIAL object creation unsuccessful''',
  2461. || crlf || '         object_creation_error = 1',
  2462. || crlf || '      end' || crlf,
  2463. || crlf || '/* and then do all of this until the end of the subroutine... */' || crlf,
  2464. || crlf || '/* Create an object for yarnshell_cmd */',
  2465. || crlf || '   title = ''YARN Program for^'' || home', 
  2466. || crlf || '   exename = home || ''\' || yarnshell_cmd || '''',
  2467. || crlf || '   iconfile = home || ''\icons\' || yarn_ico || '''',
  2468. || crlf || '   startupdir = home' || crlf,
  2469. || crlf || '   setup = ''OBJECTID=<'' || title || ''>'' ||,',
  2470. || crlf || '            '';ICONFILE='' || iconfile ||,',
  2471. || crlf || '            '';EXENAME='' || exename ||,',
  2472. || crlf || '            '';STARTUPDIR='' || startupdir' || crlf,
  2473. || crlf || '   if SysCreateObject(classname, title, location, setup, ''U'') then',
  2474. || crlf || '      do',
  2475. || crlf || '         say YARNSHELL_CMD ''object created/updated successfully''',
  2476. || crlf || '      end',
  2477. || crlf || '   else',
  2478. || crlf || '      do',
  2479. || crlf || '         say ''YRNSHELL object creation unsuccessful''',
  2480. || crlf || '         object_creation_error = 1',
  2481. || crlf || '      end' || crlf,
  2482. || crlf || '/* Create an object for yarnutil_cmd */',
  2483. || crlf || '   title = ''YarnUtil from^'' || home',
  2484. || crlf || '   exename = home || ''\' || yarnutil_cmd || '''',
  2485. || crlf || '   iconfile = home || ''\icons\' || yarnutil_ico || '''',
  2486. || crlf || '   startupdir = home' || crlf,
  2487. || crlf || '   setup = ''OBJECTID=<'' || title || ''>'' ||,',
  2488. || crlf || '            '';ICONFILE='' || iconfile ||,',
  2489. || crlf || '            '';EXENAME='' || exename ||,',
  2490. || crlf || '            '';STARTUPDIR='' || startupdir' || crlf,
  2491. || crlf || '   if SysCreateObject(classname, title, location, setup, ''U'') then',
  2492. || crlf || '      do',
  2493. || crlf || '         say YARNUTIL_CMD ''object created/updated successfully''',
  2494. || crlf || '      end',
  2495. || crlf || '   else',
  2496. || crlf || '      do',
  2497. || crlf || '         say ''YRNUTIL object creation unsuccessful''',
  2498. || crlf || '         object_creation_error = 1',
  2499. || crlf || '      end' || crlf,
  2500. || crlf || '/* Create an object for logoff_cmd */',
  2501. || crlf || '   title = ''Logoff running from^'' || home',
  2502. || crlf || '   exename = home || ''\' || logoff_cmd || '''',
  2503. || crlf || '   iconfile = home || ''\icons\' || logoff_ico || '''',
  2504. || crlf || '   startupdir = home' || crlf,
  2505. || crlf || '   setup = ''OBJECTID=<'' || title || ''>'' ||,',
  2506. || crlf || '            '';ICONFILE='' || iconfile ||,',
  2507. || crlf || '            '';EXENAME='' || exename ||,',
  2508. || crlf || '            '';STARTUPDIR='' || startupdir' || crlf,
  2509. || crlf || '   if SysCreateObject(classname, title, location, setup, ''U'') then',
  2510. || crlf || '      do',
  2511. || crlf || '         say LOGOFF_CMD ''object created/updated successfully''',
  2512. || crlf || '      end',
  2513. || crlf || '   else',
  2514. || crlf || '      do',
  2515. || crlf || '         say ''LOGOFF object creation unsuccessful''',
  2516. || crlf || '         object_creation_error = 1',
  2517. || crlf || '     end' || crlf,
  2518. || crlf || '/* Create an object for renewzip_cmd */',
  2519. || crlf || '   title = ''Reply Zip Restorer for^'' || translate(''' || reply_packet || ''', Lowcase, Upcase) /* to lower case */', 
  2520. || crlf || '   exename = home || ''\' || renewzip_cmd || '''',
  2521. || crlf || '   iconfile = home || ''\icons\' || renewzip_ico || '''',
  2522. || crlf || '   startupdir = home' || crlf,
  2523. || crlf || '   setup = ''OBJECTID=<'' || title || ''>'' ||,',
  2524. || crlf || '            '';ICONFILE='' || iconfile ||,',
  2525. || crlf || '            '';EXENAME='' || exename ||,',
  2526. || crlf || '            '';STARTUPDIR='' || startupdir' || crlf,
  2527. || crlf || '   if SysCreateObject(classname, title, location, setup, ''U'') then',
  2528. || crlf || '      do',
  2529. || crlf || '         say RENEWZIP_CMD ''object created/updated successfully''',
  2530. || crlf || '      end',
  2531. || crlf || '   else',
  2532. || crlf || '      do',
  2533. || crlf || '         say ''RENEWZIP object creation unsuccessful''',
  2534. || crlf || '         object_creation_error = 1',
  2535. || crlf || '      end',
  2536. || crlf || 'END  /* creating program objects in the Desktop Folder we created */ ' ,
  2537. || crlf || 'say ''''',
  2538. || crlf || 'say ''Press any key to exit...''',        
  2539. || crlf || 'answer = SysGetKey(''NOECHO'')'
  2540.  
  2541. call lineout objects_cmd, dataline
  2542. call stream objects_cmd, 'c', 'close'
  2543. say '  ' objects_cmd 'created/updated successfully.'
  2544.  
  2545. RETURN
  2546.  
  2547. /*
  2548. ==============================================
  2549. HANDLING OF ERROR TRAPS
  2550.  
  2551. ReXX Errors (failure, halt, syntax, novalue, error)
  2552. that occur with SIGNAL ON XXXXX (XXXXX = failure,
  2553. halt, etc.) are diverted (jump) to one of these
  2554. where the error and the offending line are identified.
  2555. ==============================================
  2556. */
  2557.  
  2558. FAILURE:
  2559. say 'Rexx FAILURE error' rc 'in line' sigl || ':' errortext(rc) crlf sourceline(sigl)
  2560. call beep 300, 500
  2561. /*trace ?r; nop*/
  2562. signal goodbye
  2563. RETURN
  2564.  
  2565. HALT:
  2566. say 'Rexx HALT' rc 'in line' sigl || ':' errortext(rc) crlf sourceline(sigl)
  2567. call beep 300, 500
  2568. /*trace ?r; nop*/
  2569. signal goodbye
  2570. RETURN
  2571.  
  2572. SYNTAX:
  2573. say 'Rexx SYNTAX error' rc 'in line' sigl || ':' errortext(rc) crlf sourceline(sigl)
  2574. call beep 300, 500
  2575. /*trace ?r; nop*/
  2576. signal goodbye
  2577. RETURN
  2578.  
  2579. NOTREADY:
  2580. say 'Rexx NOTREADY error' rc 'in line' sigl || ':' errortext(rc) crlf sourceline(sigl)
  2581. call beep 300, 500
  2582. /*trace ?r; nop*/
  2583. signal goodbye
  2584. RETURN
  2585.  
  2586. ERROR:
  2587. say 'Rexx ERROR error' rc 'in line' sigl || ':' errortext(rc) crlf sourceline(sigl)
  2588. call beep 300, 500
  2589. /*trace ?r; nop*/
  2590. signal goodbye
  2591. RETURN
  2592.  
  2593. /*
  2594. ==============================================
  2595. GOODBYE()
  2596.  
  2597. Final "we did it" or "we didn't" message, and exit
  2598. ==============================================
  2599. */
  2600. GOODBYE:
  2601. say ''
  2602. if completed & findfile_ErrNum = 0 then
  2603.    do
  2604.       say 'Installation completed successfully'
  2605.       if object_creation_error then
  2606.          do
  2607.             say 'EXCEPT for desktop object creation.  All .CMD files'
  2608.             say 'are in the' home 'directory, though.'
  2609.          end
  2610.    end
  2611. if completed & findfile_ErrNum > 0 then
  2612.    do
  2613.       call SysCls
  2614.       say 'Installation completed.'
  2615.    end
  2616. if \completed | findfile_ErrNum > 0 then
  2617.    do
  2618.       say ''
  2619.       say '*************'
  2620.       say '   WARNING:'
  2621.       say 'An error was encountered during the installation'
  2622.       say '   or'
  2623.       say 'the installation was aborted before completion'
  2624.       say '*************'
  2625.       say ''
  2626.       call beep 262, 200
  2627.    end 
  2628. if completed then
  2629.    do
  2630.       say 'You may want to print out and inspect' ydparms_dat
  2631.       say 'Changes to it may be made using an ASCII editor such as the'
  2632.       say 'OS/2 System Editor without having to re-run' ydinstl_cmd
  2633.       say ''
  2634.    end
  2635. if findfile_ErrNum > 0 then
  2636.    do
  2637.       if findfile_ErrNum > 0 then
  2638.          do
  2639.             say ''
  2640.             say 'ERROR(S):'
  2641.             do while findfile_ErrNum > 0
  2642.                say 'Unable to locate any instance of',  
  2643.                  unfound_file.findfile_ErrNum
  2644.                findfile_ErrNum = findfile_ErrNum - 1
  2645.                say ''
  2646.             end
  2647.          end
  2648.    end
  2649. say ''
  2650. say edit_dialup_string_msg
  2651. say 'YarnDial installation over at' time()
  2652. time = time('E')
  2653. time = time/60
  2654. time = format(time, ,1) 
  2655. say 'Elapsed time:' time 'minutes.'
  2656. say ''
  2657. say 'Press any key to exit...'
  2658. answer = SysGetKey('NOECHO')
  2659. call SysDropFuncs
  2660. x = endLocal()
  2661. EXIT
  2662. RETURN
  2663.  
  2664. /*
  2665. ==============================================
  2666. welcome_to_this_installer()
  2667.  
  2668. Long welcome message.  Put here for a neater
  2669. program, though we call to it near startup.
  2670. ==============================================
  2671. */
  2672. welcome_to_this_installer:
  2673. call SysCls
  2674. say ''
  2675. say 'Welcome! YARNDIAL installer, v.' version 'of' translate(ydinstl_cmd)
  2676. say '(c) 1996 Jerry Levy, Marblehead, MA USA (all rights reserved).'
  2677. say ''
  2678. say 'ABOUT THIS INSTALLER'
  2679. say 'This will install YarnDial on your machine, copying files to the'
  2680. say 'Yarn Home directory.  It should be very straightforward to use if'
  2681. say 'you have Yarn and Souper already up and running and did a pretty'
  2682. say 'much by-the-book installation of them.'
  2683. say ''
  2684. say 'If you have more than one Yarn home directory (Yarn allows separate'
  2685. say 'home directories for separate users or providers), you can select a'
  2686. say 'default or specify which one(s) to install to.'
  2687. say ''
  2688. say 'Each installation creates a unique' translate(ydparms_dat) 'data file'
  2689. say 'and a suite of customized Rexx .CMD programs, all of which get'
  2690. say 'stored in the particular home directory you are installing to.'
  2691. say 'A YarnDial Desktop Folder is created to house program objects.'
  2692. say ''
  2693. say translate(ydparms_dat) 'can be edited after the installation.'
  2694. say ''
  2695. say '(Continued -- Press any key)'
  2696. call SysGetKey 'NOECHO'
  2697. call SysCls
  2698. say ''
  2699. say 'INSTRUCTIONS (cont''d)'
  2700. say 'You will be asked what kind of zip and unzip utilities you are using.'
  2701. say 'Read' yd_doc 'if you need help.'
  2702. say ''
  2703. say 'No changes are made to your system until the very end of the installation,'
  2704. say 'so you may run through it without risk and escape out before the end.'
  2705. say ''
  2706. say ''
  2707. say '' 
  2708. say 'Press any key to continue the installation (ESC quits)'
  2709. if SysGetKey('NOECHO') = Escape then signal goodbye
  2710. RETURN
  2711.  
  2712. /*
  2713. ==============================================
  2714. initialize_variables():
  2715.  
  2716. We make an early call to this to initialize
  2717. variables.  A long list so we put the routine
  2718. at the end of the program for neatness sake.
  2719. ==============================================
  2720. */
  2721. initialize_variables:
  2722. /* Default filenames and other stuff we need.
  2723.  
  2724. These are initialized to something because we want default values */
  2725. yarn_exe = 'YARN.EXE'
  2726. import_exe = 'IMPORT.EXE'
  2727. export_exe = 'EXPORT.EXE'
  2728. expire_exe = 'EXPIRE.EXE'
  2729. rebuild_exe = 'REBUILD.EXE'
  2730. filter_exe = 'FILTER.EXE'
  2731. souper_exe = 'SOUPER.EXE'
  2732. yarnshell_cmd = 'YRNSHELL.CMD'
  2733. yarnutil_cmd = 'YRNUTIL.CMD'
  2734. renewzip_cmd = 'RENEWZIP.CMD'
  2735. objects_cmd = 'OBJECTS.CMD'
  2736. logoff_cmd = 'LOGOFF.CMD'
  2737. go_exe = 'GO.EXE'
  2738. IAKdialer_exe = 'DIALER.EXE'
  2739. slippm_exe = 'SLIPPM.EXE'
  2740. killjoy_exe = 'KILLJOY.EXE'
  2741. injoy_exe = 'IN-JOY.EXE'
  2742. os2_zip_exe = 'ZIP.EXE'
  2743. os2_unzip_exe = 'UNZIP.EXE'
  2744. os2_zip_options = '-0m'
  2745. os2_unzip_options = '-o'
  2746. msdos_zip_exe = 'PKZIP.EXE'
  2747. msdos_unzip_exe = 'PKUNZIP.EXE'
  2748. msdos_zip_options = '-m -u -o'
  2749. msdos_unzip_options = '-o'
  2750. msdos_cmd_interp = 'CMD.EXE /C'
  2751. souper_getmail_std_options = '-i -n' 
  2752. getmail_xtra_options = '' 
  2753. souper_getnews_std_options = '-i -m' 
  2754. getnews_xtra_options = '' 
  2755. souper_send_std_options = '-i -s'
  2756. send_xtra_options = ''
  2757.  
  2758.  
  2759. /*
  2760. ===============
  2761. We set these remaining variables initially to a blank.
  2762. Some will become set in the course of the installation.
  2763. We do not want the yarndial data file we create
  2764. (YD_PARMS.DAT) to be all cluttered up with error
  2765. indications which is what happens if we don't assign
  2766. the blanks.
  2767. ===============
  2768. */
  2769. HOME=''
  2770. YARN=''
  2771. connection_type=''
  2772. user=''
  2773. host = ''
  2774. adv_account=''
  2775. adv_popserver=''
  2776. adv_newsserver=''
  2777. adv_password=''
  2778. adv_smtpserver=''
  2779. ASK = ''
  2780. GS = ''
  2781. WS = ''
  2782. DN1 = ''
  2783. DN2 = ''
  2784. IS1 = ''
  2785. IS2 = ''
  2786. RS1 = ''
  2787. RS2 = ''
  2788. FS1 = ''
  2789. FS2 = ''
  2790. PIN = ''
  2791. MD = ''
  2792. EMI = ''
  2793. wait = '' 
  2794. zip_exe = ''
  2795. unzip_exe = ''
  2796. tcpos2ini_app = ''
  2797. dialup_string = ''
  2798. Use_dialup_string = 'NO'
  2799. PROVIDER = ''
  2800. LOGIN_ID = ''
  2801. PWD = ''
  2802. SAVE_PWD = ''
  2803. PHONE_NUMBER = ''
  2804. HANGUP =  ''
  2805. SCRIPT = ''
  2806. SERVICE = ''
  2807. YOURIP = ''
  2808. DESTIP = ''
  2809. NETMASK = ''
  2810. MTU_SIZE = ''
  2811. VJ_COMP = ''
  2812. HOSTNAME = ''
  2813. DOMAIN_NAME = ''
  2814. DNS = ''
  2815. DEFAULT_NEWS = ''
  2816. DEFAULT_WWW = ''
  2817. DEFAULT_GOPHER = ''
  2818. MAIL_GW = ''
  2819. POPSRVR = ''
  2820. REPLY_DOMAIN = ''
  2821. REPLY_ID = ''
  2822. POP_ID = ''
  2823. POP_PWD = ''
  2824. MODEM_TYPE = ''
  2825. COMPORT = ''
  2826. BAUD = ''
  2827. DATABITS = ''
  2828. PARITY =  ''
  2829. DIAL_MODE = ''
  2830. PREFIX = ''
  2831. PREFIX_ANS = ''
  2832. INIT = ''
  2833. INIT2 = ''
  2834. DISABLE = ''
  2835. DISABLE_SEQ = ''
  2836. DIAL_PREFIX = ''
  2837. AUTOSTART = ''
  2838. TOTAL_CONNECT = ''
  2839.  
  2840. RETURN
  2841.  
  2842.  
  2843.